Class: ThinkingSphinx::RealTime::Translator
- Inherits:
-
Object
- Object
- ThinkingSphinx::RealTime::Translator
- Defined in:
- lib/thinking_sphinx/real_time/translator.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(object, column) ⇒ Translator
constructor
A new instance of Translator.
Constructor Details
#initialize(object, column) ⇒ Translator
Returns a new instance of Translator.
8 9 10 |
# File 'lib/thinking_sphinx/real_time/translator.rb', line 8 def initialize(object, column) @object, @column = object, column end |
Class Method Details
.call(object, column) ⇒ Object
4 5 6 |
# File 'lib/thinking_sphinx/real_time/translator.rb', line 4 def self.call(object, column) new(object, column).call end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/thinking_sphinx/real_time/translator.rb', line 12 def call return name.call(object) if name.is_a?(Proc) return name unless name.is_a?(Symbol) return result unless result.is_a?(String) result.gsub("\u0000", '').force_encoding "UTF-8" end |