Class: Elasticband::Filter::Term
- Inherits:
-
Elasticband::Filter
- Object
- Elasticband::Filter
- Elasticband::Filter::Term
- Defined in:
- lib/elasticband/filter/term.rb
Constant Summary
Constants inherited from Elasticband::Filter
Instance Attribute Summary collapse
-
#field ⇒ Object
Returns the value of attribute field.
-
#filter ⇒ Object
Returns the value of attribute filter.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(filter, field, options = {}) ⇒ Term
constructor
A new instance of Term.
- #to_h ⇒ Object
Methods inherited from Elasticband::Filter
Constructor Details
#initialize(filter, field, options = {}) ⇒ Term
Returns a new instance of Term.
6 7 8 9 10 |
# File 'lib/elasticband/filter/term.rb', line 6 def initialize(filter, field, = {}) self.filter = filter self.field = field.to_sym self. = end |
Instance Attribute Details
#field ⇒ Object
Returns the value of attribute field.
4 5 6 |
# File 'lib/elasticband/filter/term.rb', line 4 def field @field end |
#filter ⇒ Object
Returns the value of attribute filter.
4 5 6 |
# File 'lib/elasticband/filter/term.rb', line 4 def filter @filter end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/elasticband/filter/term.rb', line 4 def @options end |
Instance Method Details
#to_h ⇒ Object
12 13 14 |
# File 'lib/elasticband/filter/term.rb', line 12 def to_h { term: filter_hash } end |