Class: Eson::Search::QueryField
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Eson::Search::QueryField
- Defined in:
- lib/eson/search/query_field.rb
Instance Method Summary collapse
- #_name ⇒ Object
- #_options ⇒ Object
-
#initialize(name, *fields) ⇒ QueryField
constructor
A new instance of QueryField.
- #to_query_hash ⇒ Object
Constructor Details
#initialize(name, *fields) ⇒ QueryField
Returns a new instance of QueryField.
6 7 8 9 10 11 12 13 14 |
# File 'lib/eson/search/query_field.rb', line 6 def initialize(name, *fields) @_name = name if fields.length == 1 && Hash === fields.first super(fields.first) else @list = fields end end |
Instance Method Details
#_name ⇒ Object
24 25 26 |
# File 'lib/eson/search/query_field.rb', line 24 def _name @_name end |
#_options ⇒ Object
28 29 30 |
# File 'lib/eson/search/query_field.rb', line 28 def @_table end |
#to_query_hash ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/eson/search/query_field.rb', line 16 def to_query_hash if @list { _name => @list } else { _name => @table } end end |