YUKI Hiroshi
yuki****@clear*****
Wed Apr 22 10:58:07 JST 2015
確かに、同様の使い方のPathモジュールだとそのように書かれてますね。 そういう挙動の違いがあるというのは知りませんでした…… (includeしないで使うモジュールのメソッドはmodule_functionと書くものだ、 という憶え方をしていました) Kouhei Sutou wrote: > Tagをincludeする使い方を想定していない(たぶん、今回はそうで > すよね)ならmodule_functionにするんじゃなくてclass << selfで > 定義したほうが意図が明確になりますよ。module_functionだと > includeしても使えるんですよ。 > > In <1593ab181d04e5d3a1e8d7b6da82edb3732f9e11 �� jenkins.clear-code.com> > "[Groonga-commit] droonga/droonga-engine �� 1593ab1 [master] Fix indent" on Tue, 21 Apr 2015 19:19:23 +0900, > YUKI Hiroshi <null+groonga �� clear-code.com> wrote: > >> YUKI Hiroshi 2015-04-21 19:19:23 +0900 (Tue, 21 Apr 2015) >> >> New Revision: 1593ab181d04e5d3a1e8d7b6da82edb3732f9e11 >> https://github.com/droonga/droonga-engine/commit/1593ab181d04e5d3a1e8d7b6da82edb3732f9e11 >> >> Message: >> Fix indent >> >> Modified files: >> lib/droonga/serf/tag.rb >> >> Modified: lib/droonga/serf/tag.rb (+28 -28) >> =================================================================== >> --- lib/droonga/serf/tag.rb 2015-04-21 19:18:31 +0900 (9b33cdc) >> +++ lib/droonga/serf/tag.rb 2015-04-21 19:19:23 +0900 (a537e6b) >> @@ -17,43 +17,43 @@ module Droonga >> class Serf >> module Tag >> module_function >> - def node_type >> - "type" >> - end >> + def node_type >> + "type" >> + end >> >> - def node_role >> - "role" >> - end >> + def node_role >> + "role" >> + end >> >> - def internal_node_name >> - "internal-name" >> - end >> + def internal_node_name >> + "internal-name" >> + end >> >> - def cluster_id >> - "cluster_id" >> - end >> + def cluster_id >> + "cluster_id" >> + end >> >> - def accept_messages_newer_than >> - "accept-newer-than" >> - end >> + def accept_messages_newer_than >> + "accept-newer-than" >> + end >> >> - def last_processed_message_timestamp >> - "last-timestamp" >> - end >> + def last_processed_message_timestamp >> + "last-timestamp" >> + end >> >> - HAVE_UNPROCESSED_MESSAGES_TAG_PREFIX = "buffered-for-" >> + HAVE_UNPROCESSED_MESSAGES_TAG_PREFIX = "buffered-for-" >> >> - def have_unprocessed_messages_tag_for(node_name) >> - "#{HAVE_UNPROCESSED_MESSAGES_TAG_PREFIX}#{node_name}" >> - end >> + def have_unprocessed_messages_tag_for(node_name) >> + "#{HAVE_UNPROCESSED_MESSAGES_TAG_PREFIX}#{node_name}" >> + end >> >> - def have_unprocessed_messages_tag?(tag) >> - tag.start_with?(HAVE_UNPROCESSED_MESSAGES_TAG_PREFIX) >> - end >> + def have_unprocessed_messages_tag?(tag) >> + tag.start_with?(HAVE_UNPROCESSED_MESSAGES_TAG_PREFIX) >> + end >> >> - def extract_node_name_from_have_unprocessed_messages_tag(tag) >> - tag.sub(HAVE_UNPROCESSED_MESSAGES_TAG_PREFIX, "") >> - end >> + def extract_node_name_from_have_unprocessed_messages_tag(tag) >> + tag.sub(HAVE_UNPROCESSED_MESSAGES_TAG_PREFIX, "") >> + end >> end >> end >> end > > _______________________________________________ > Groonga-commit mailing list > Groonga-commit �� lists.sourceforge.jp > http://lists.sourceforge.jp/mailman/listinfo/groonga-commit > -- 結城 洋志 <YUKI Hiroshi> E-mail: yuki �� clear-code.com 株式会社クリアコード 〒170-0005 東京都豊島区南大塚3-29-9 中野ビル3階 TEL : 03-5927-9440 FAX : 03-5927-9441 WWW : http://www.clear-code.com/