class ThinkingSphinx::Middlewares::Geographer::Inner
Attributes
context[R]
Public Class Methods
new(context)
click to toggle source
# File lib/thinking_sphinx/middlewares/geographer.rb, line 19 def initialize(context) @context = context end
Public Instance Methods
call()
click to toggle source
# File lib/thinking_sphinx/middlewares/geographer.rb, line 23 def call return unless geo context[:sphinxql].prepend_values geodist_clause context[:panes] << ThinkingSphinx::Panes::DistancePane end
Private Instance Methods
fixed_format(float)
click to toggle source
# File lib/thinking_sphinx/middlewares/geographer.rb, line 36 def fixed_format(float) ThinkingSphinx::FloatFormatter.new(float).fixed end
geodist_clause()
click to toggle source
# File lib/thinking_sphinx/middlewares/geographer.rb, line 44 def geodist_clause "GEODIST(#{fixed_format geo.first}, #{fixed_format geo.last}, #{latitude}, #{longitude}) AS geodist" end
geolocation_attributes()
click to toggle source
# File lib/thinking_sphinx/middlewares/geographer.rb, line 40 def geolocation_attributes @geolocation_attributes ||= GeolocationAttributes.new(context) end