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 51 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 57 def geo search_context_options[:geo] end
Private Instance Methods
indices()
click to toggle source
# File lib/thinking_sphinx/middlewares/geographer.rb, line 81 def indices context[:indices] end
latitude_attr()
click to toggle source
# File lib/thinking_sphinx/middlewares/geographer.rb, line 73 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 77 def longitude_attr @longitude_attr ||= search_context_options[:longitude_attr] end
names()
click to toggle source
# File lib/thinking_sphinx/middlewares/geographer.rb, line 85 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 89 def search_context_options @search_context_options ||= context.search.options end