Class: Sunspot::Query::FunctionalFunctionQuery

Inherits:
FunctionQuery show all
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 Method Summary collapse

Methods inherited from FunctionQuery

#^

Constructor Details

#initialize(function_name, function_args) ⇒ FunctionalFunctionQuery

Returns a new instance of FunctionalFunctionQuery.



47
48
49
# File 'lib/sunspot/query/function_query.rb', line 47

def initialize(function_name, function_args)
  @function_name, @function_args = function_name, function_args
end

Instance Method Details

#to_sObject



51
52
53
54
# File 'lib/sunspot/query/function_query.rb', line 51

def to_s
  params = @function_args.map { |arg| arg.to_s }.join(",")
  "#{@function_name}(#{params})" << (@boost_amount ? "^#{@boost_amount}" : "")
end