Kouhei Sutou
null+****@clear*****
Wed Jan 13 17:16:57 JST 2016
Kouhei Sutou 2012-11-25 17:46:41 +0900 (Sun, 25 Nov 2012) New Revision: 94ae9ac2048fc07d5cbb0e8ada3d6553c0cea330 https://github.com/groonga/groonga-command/commit/94ae9ac2048fc07d5cbb0e8ada3d6553c0cea330 Message: Add Base#[] Modified files: lib/groonga/command/base.rb lib/groonga/command/select.rb Modified: lib/groonga/command/base.rb (+5 -0) =================================================================== --- lib/groonga/command/base.rb 2012-11-25 17:45:38 +0900 (b921f0d) +++ lib/groonga/command/base.rb 2012-11-25 17:46:41 +0900 (3bf72b3) @@ -47,6 +47,11 @@ module Groonga @original_format = nil end + def [](name) + name = name.to_sym if name.is_a?(String) + @arguments[name] + end + def ==(other) other.is_a?(self.class) and @name == other.name and Modified: lib/groonga/command/select.rb (+6 -6) =================================================================== --- lib/groonga/command/select.rb 2012-11-25 17:45:38 +0900 (a87ff5e) +++ lib/groonga/command/select.rb 2012-11-25 17:46:41 +0900 (fa1762b) @@ -30,19 +30,19 @@ module Groonga end def sortby - @arguments[:sortby] + self[:sortby] end def scorer - @arguments[:scorer] + self[:scorer] end def query - @arguments[:query] + self[:query] end def filter - @arguments[:filter] + self[:filter] end def conditions @@ -55,11 +55,11 @@ module Groonga end def drilldowns - @drilldowns ||= (@arguments[:drilldown] || "").split(/\s*,\s*/) + @drilldowns ||= (self[:drilldown] || "").split(/\s*,\s*/) end def output_columns - @arguments[:output_columns] + self[:output_columns] end end end -------------- next part -------------- HTML����������������������������...Download