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



15
16
17
# File 'lib/sunspot/dsl/function.rb', line 15

def method_missing(method, *args, &block)
  create_function_query(method, *args)
end

Instance Method Details

#sub(*args) ⇒ Object

Special case to handle <wiki.apache.org/solr/FunctionQuery#sub> because ‘Kernel#sub` exists so `method_missing` will not be called for this function.



11
12
13
# File 'lib/sunspot/dsl/function.rb', line 11

def sub(*args) #:nodoc:
  create_function_query(:sub, *args)
end