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
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#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.
8 9 10 11 12 |
# File 'lib/thinking_sphinx/real_time/property.rb', line 8 def initialize(column, = {}) @options = @column = column.respond_to?(:__name) ? column : ThinkingSphinx::ActiveRecord::Column.new(column) end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
6 7 8 |
# File 'lib/thinking_sphinx/real_time/property.rb', line 6 def column @column end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/thinking_sphinx/real_time/property.rb', line 6 def @options end |
Instance Method Details
#name ⇒ Object
14 15 16 |
# File 'lib/thinking_sphinx/real_time/property.rb', line 14 def name (@options[:as] || @column.__name).to_s end |
#translate(object) ⇒ Object
18 19 20 |
# File 'lib/thinking_sphinx/real_time/property.rb', line 18 def translate(object) ThinkingSphinx::RealTime::Translator.call(object, @column) end |