Class: ThinkingSphinx::Core::Interpreter

Inherits:
BasicObject
Defined in:
lib/thinking_sphinx/core/interpreter.rb

Direct Known Subclasses

ActiveRecord::Interpreter, RealTime::Interpreter

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Interpreter) initialize(index, block)

Returns a new instance of Interpreter



6
7
8
9
10
11
12
# File 'lib/thinking_sphinx/core/interpreter.rb', line 6

def initialize(index, block)
  @index = index

  mod = ::Module.new
  mod.send :define_method, :translate!, block
  mod.send :extend_object, self
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

- (Object) method_missing(method, *args) (private)



16
17
18
# File 'lib/thinking_sphinx/core/interpreter.rb', line 16

def method_missing(method, *args)
  ::ThinkingSphinx::ActiveRecord::Column.new method, *args
end

Class Method Details

+ (Object) translate!(index, block)



2
3
4
# File 'lib/thinking_sphinx/core/interpreter.rb', line 2

def self.translate!(index, block)
  new(index, block).translate!
end