Class: Sunspot::Query::FunctionalFunctionQuery
- Inherits:
-
FunctionQuery
- Object
- FunctionQuery
- Sunspot::Query::FunctionalFunctionQuery
- Defined in:
- lib/sunspot/query/function_query.rb
Overview
Function query which represents an actual function invocation. Takes a function name and arguments as parameters. Arguments are in turn FunctionQuery objects.
Instance Attribute Summary collapse
-
#function_args ⇒ Object
readonly
Returns the value of attribute function_args.
-
#function_name ⇒ Object
readonly
Returns the value of attribute function_name.
Attributes inherited from FunctionQuery
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(function_name, function_args) ⇒ FunctionalFunctionQuery
constructor
A new instance of FunctionalFunctionQuery.
- #to_s ⇒ Object
Methods inherited from FunctionQuery
Constructor Details
#initialize(function_name, function_args) ⇒ FunctionalFunctionQuery
Returns a new instance of FunctionalFunctionQuery.
65 66 67 |
# File 'lib/sunspot/query/function_query.rb', line 65 def initialize(function_name, function_args) @function_name, @function_args = function_name, function_args end |
Instance Attribute Details
#function_args ⇒ Object (readonly)
Returns the value of attribute function_args.
63 64 65 |
# File 'lib/sunspot/query/function_query.rb', line 63 def function_args @function_args end |
#function_name ⇒ Object (readonly)
Returns the value of attribute function_name.
63 64 65 |
# File 'lib/sunspot/query/function_query.rb', line 63 def function_name @function_name end |
Instance Method Details
#==(other) ⇒ Object
74 75 76 77 |
# File 'lib/sunspot/query/function_query.rb', line 74 def ==(other) super and @function_name == other.function_name and @function_args == other.function_args end |
#to_s ⇒ Object
69 70 71 72 |
# File 'lib/sunspot/query/function_query.rb', line 69 def to_s params = @function_args.map { |arg| arg.to_s }.join(",") "#{@function_name}(#{params})" << (@boost_amount ? "^#{@boost_amount}" : "") end |