Class: Elasticband::Query::ScoreFunction::FieldValueFactor
- Inherits:
-
Elasticband::Query::ScoreFunction
- Object
- Elasticband::Query::ScoreFunction
- Elasticband::Query::ScoreFunction::FieldValueFactor
- Defined in:
- lib/elasticband/query/score_function/field_value_factor.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
Returns the value of attribute field.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(field, options = {}) ⇒ FieldValueFactor
constructor
A new instance of FieldValueFactor.
- #to_h ⇒ Object
Constructor Details
#initialize(field, options = {}) ⇒ FieldValueFactor
Returns a new instance of FieldValueFactor.
7 8 9 10 |
# File 'lib/elasticband/query/score_function/field_value_factor.rb', line 7 def initialize(field, = {}) self.field = field.to_sym self. = end |
Instance Attribute Details
#field ⇒ Object
Returns the value of attribute field.
5 6 7 |
# File 'lib/elasticband/query/score_function/field_value_factor.rb', line 5 def field @field end |
#options ⇒ Object
Returns the value of attribute options.
5 6 7 |
# File 'lib/elasticband/query/score_function/field_value_factor.rb', line 5 def @options end |
Instance Method Details
#to_h ⇒ Object
12 13 14 |
# File 'lib/elasticband/query/score_function/field_value_factor.rb', line 12 def to_h { field_value_factor: function_hash } end |