Class: ThinkingSphinx::RealTime::Property
- Inherits:
-
Object
- Object
- ThinkingSphinx::RealTime::Property
- Includes:
- Core::Property
- Defined in:
- lib/thinking_sphinx/real_time/property.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(column, options = {}) ⇒ Property
constructor
A new instance of Property.
- #name ⇒ Object
- #translate(object) ⇒ Object
Methods included from Core::Property
Constructor Details
#initialize(column, options = {}) ⇒ Property
Returns a new instance of Property.
6 7 8 |
# File 'lib/thinking_sphinx/real_time/property.rb', line 6 def initialize(column, = {}) @column, = column, end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/thinking_sphinx/real_time/property.rb', line 4 def end |
Instance Method Details
#name ⇒ Object
10 11 12 |
# File 'lib/thinking_sphinx/real_time/property.rb', line 10 def name ([:as] || @column.__name).to_s end |
#translate(object) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/thinking_sphinx/real_time/property.rb', line 14 def translate(object) return @column.__name unless @column.__name.is_a?(Symbol) base = @column.__stack.inject(object) { |base, node| base.try(node) } base.try(@column.__name) end |