Class: Sunspot::DSL::Function

Inherits:
Object
  • Object
show all
Defined in:
lib/sunspot/dsl/function.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(functional) ⇒ Function

:nodoc:



4
5
6
# File 'lib/sunspot/dsl/function.rb', line 4

def initialize(functional) #:nodoc:
  @functional = functional
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



8
9
10
11
# File 'lib/sunspot/dsl/function.rb', line 8

def method_missing(method, *args, &block)
  function_args = args.map { |arg| @functional.create_function_query(arg) }
  Sunspot::Query::FunctionalFunctionQuery.new(method, function_args)
end