Class: Sunspot::DSL::Function

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

Overview

:nodoc:

Instance Method Summary (collapse)

Constructor Details

- (Function) initialize(functional)

:nodoc:



4
5
6
# File 'sunspot/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

- (Object) method_missing(method, *args, &block)



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

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

Instance Method Details

- (Object) sub(*args)

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 'sunspot/lib/sunspot/dsl/function.rb', line 11

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