class ThinkingSphinx::Middlewares::Geographer::Inner::GeolocationAttributes

Attributes

context[RW]
latitude[RW]
longitude[RW]

Public Class Methods

new(context) click to toggle source
# File lib/thinking_sphinx/middlewares/geographer.rb, line 49
def initialize(context)
  self.context   = context
  self.latitude  = latitude_attr if latitude_attr
  self.longitude = longitude_attr if longitude_attr
end

Public Instance Methods

geo() click to toggle source
# File lib/thinking_sphinx/middlewares/geographer.rb, line 55
def geo
  search_context_options[:geo]
end

Private Instance Methods

indices() click to toggle source
# File lib/thinking_sphinx/middlewares/geographer.rb, line 79
def indices
  context[:indices]
end
latitude_attr() click to toggle source
# File lib/thinking_sphinx/middlewares/geographer.rb, line 71
def latitude_attr
  @latitude_attr ||= search_context_options[:latitude_attr]
end
longitude_attr() click to toggle source
# File lib/thinking_sphinx/middlewares/geographer.rb, line 75
def longitude_attr
  @longitude_attr ||= search_context_options[:longitude_attr]
end
names() click to toggle source
# File lib/thinking_sphinx/middlewares/geographer.rb, line 83
def names
  @names ||= indices.collect(&:unique_attribute_names).flatten.uniq
end
search_context_options() click to toggle source
# File lib/thinking_sphinx/middlewares/geographer.rb, line 87
def search_context_options
  @search_context_options ||= context.search.options
end