Class: ThinkingSphinx::Core::Interpreter

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index, block) ⇒ Interpreter

Returns a new instance of Interpreter.



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

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

#method_missing(method, *args) ⇒ Object (private)



22
23
24
# File 'lib/thinking_sphinx/core/interpreter.rb', line 22

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

Class Method Details

.translate!(index, block) ⇒ Object



4
5
6
# File 'lib/thinking_sphinx/core/interpreter.rb', line 4

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