Sha256: 5b6239c3b74af34e08cc9fcbff786e5922e731cd80d112d9618fe79c90d95ec9

Contents?: true

Size: 452 Bytes

Versions: 5

Compression:

Stored size: 452 Bytes

Contents

class ThinkingSphinx::RealTime::Property
  include ThinkingSphinx::Core::Property

  attr_reader :column, :options

  def initialize(column, options = {})
    @options = options
    @column  = column.respond_to?(:__name) ? column :
      ThinkingSphinx::ActiveRecord::Column.new(column)
  end

  def name
    (@options[:as] || @column.__name).to_s
  end

  def translate(object)
    ThinkingSphinx::RealTime::Translator.call(object, @column)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
thinking-sphinx-3.4.2 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-3.4.1 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-3.4.0 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-3.3.0 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-3.2.0 lib/thinking_sphinx/real_time/property.rb