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 Method Summary collapse
-
#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.
19 20 21 |
# File 'lib/sunspot/query/function_query.rb', line 19 def initialize(constant) @constant = constant end |
Instance Method Details
#to_s ⇒ Object
23 24 25 |
# File 'lib/sunspot/query/function_query.rb', line 23 def to_s Type.to_literal(@constant) << (@boost_amount ? "^#{@boost_amount}" : "") end |