Class: ThinkingSphinx::RealTime::Interpreter

Inherits:
Core::Interpreter show all
Defined in:
lib/thinking_sphinx/real_time/interpreter.rb

Instance Method Summary collapse

Methods inherited from Core::Interpreter

#initialize, translate!

Constructor Details

This class inherits a constructor from ThinkingSphinx::Core::Interpreter

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ThinkingSphinx::Core::Interpreter

Instance Method Details

#has(*columns) ⇒ Object



4
5
6
7
8
9
# File 'lib/thinking_sphinx/real_time/interpreter.rb', line 4

def has(*columns)
  options = columns.extract_options!
  @index.attributes += columns.collect { |column|
    ::ThinkingSphinx::RealTime::Attribute.new column, options
  }
end

#indexes(*columns) ⇒ Object



11
12
13
14
15
16
# File 'lib/thinking_sphinx/real_time/interpreter.rb', line 11

def indexes(*columns)
  options = columns.extract_options!
  @index.fields += columns.collect { |column|
    ::ThinkingSphinx::RealTime::Field.new column, options
  }
end

#set_property(properties) ⇒ Object



18
19
20
21
22
# File 'lib/thinking_sphinx/real_time/interpreter.rb', line 18

def set_property(properties)
  properties.each do |key, value|
    @index.send("#{key}=", value)   if @index.class.settings.include?(key)
  end
end

#where(condition) ⇒ Object



24
25
26
# File 'lib/thinking_sphinx/real_time/interpreter.rb', line 24

def where(condition)
  @index.conditions << condition
end