Class: Sunspot::Query::ConstantFunctionQuery
- Inherits:
-
FunctionQuery
- Object
- FunctionQuery
- Sunspot::Query::ConstantFunctionQuery
- Defined in:
- lib/sunspot/query/function_query.rb
Overview
Function query which represents a constant.
Instance Attribute Summary collapse
-
#constant ⇒ Object
readonly
Returns the value of attribute constant.
Attributes inherited from FunctionQuery
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(constant) ⇒ ConstantFunctionQuery
constructor
A new instance of ConstantFunctionQuery.
- #to_s ⇒ Object
Methods inherited from FunctionQuery
Constructor Details
#initialize(constant) ⇒ ConstantFunctionQuery
Returns a new instance of ConstantFunctionQuery.
25 26 27 |
# File 'lib/sunspot/query/function_query.rb', line 25 def initialize(constant) @constant = constant end |
Instance Attribute Details
#constant ⇒ Object (readonly)
Returns the value of attribute constant.
23 24 25 |
# File 'lib/sunspot/query/function_query.rb', line 23 def constant @constant end |
Instance Method Details
#==(other) ⇒ Object
33 34 35 |
# File 'lib/sunspot/query/function_query.rb', line 33 def ==(other) super and @constant == other.constant end |
#to_s ⇒ Object
29 30 31 |
# File 'lib/sunspot/query/function_query.rb', line 29 def to_s Type.to_literal(@constant) << (@boost_amount ? "^#{@boost_amount}" : "") end |