Class: Arelastic::Queries::Filter
- Inherits:
-
Query
- Object
- Nodes::Node
- Query
- Arelastic::Queries::Filter
- Defined in:
- lib/arelastic/queries/filter.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#query ⇒ Object
Returns the value of attribute query.
Instance Method Summary collapse
- #as_elastic ⇒ Object
-
#initialize(query, options = {}) ⇒ Filter
constructor
A new instance of Filter.
Methods inherited from Query
#has_child, #has_parent, #negate, #nested
Methods inherited from Nodes::Node
#==, #convert_to_elastic, #hash, #read_option!
Methods included from Arities::Binary
Methods included from Arities::Polyadic
Methods included from Arities::Unary
Constructor Details
#initialize(query, options = {}) ⇒ Filter
Returns a new instance of Filter.
5 6 7 8 |
# File 'lib/arelastic/queries/filter.rb', line 5 def initialize(query, = {}) @query = query @options = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/arelastic/queries/filter.rb', line 4 def @options end |
#query ⇒ Object
Returns the value of attribute query.
4 5 6 |
# File 'lib/arelastic/queries/filter.rb', line 4 def query @query end |
Instance Method Details
#as_elastic ⇒ Object
10 11 12 13 14 |
# File 'lib/arelastic/queries/filter.rb', line 10 def as_elastic { 'filter' => convert_to_elastic(query) }.update() end |