Sha256: ca30021ea2a93318a092691dd6c6bd6a14d073d9d21de762403a77ec2051c5fd

Contents?: true

Size: 483 Bytes

Versions: 17

Compression:

Stored size: 483 Bytes

Contents

# frozen_string_literal: true

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

17 entries across 17 versions & 1 rubygems

Version Path
thinking-sphinx-5.6.0 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-5.5.1 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-5.5.0 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-5.4.0 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-5.3.0 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-5.2.1 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-5.2.0 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-5.1.0 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-5.0.0 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-4.4.1 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-4.4.0 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-4.3.2 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-4.3.1 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-4.3.0 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-4.2.0 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-4.1.0 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-4.0.0 lib/thinking_sphinx/real_time/property.rb