Sha256: d67a270e11e195734a4bcc0ae155acb06847fe1285883f55f7f0619ecbeba679

Contents?: true

Size: 454 Bytes

Versions: 6

Compression:

Stored size: 454 Bytes

Contents

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

  attr_reader :options

  def initialize(column, options = {})
    @column, @options = column, options
  end

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

  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
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
thinking-sphinx-3.0.5 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-3.0.4 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-3.0.3 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-3.0.2 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-3.0.1 lib/thinking_sphinx/real_time/property.rb
thinking-sphinx-3.0.0 lib/thinking_sphinx/real_time/property.rb