Class: Eson::Search::GeoDistance
- Inherits:
-
Object
- Object
- Eson::Search::GeoDistance
- Defined in:
- lib/eson/search/geo_distance.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
Returns the value of attribute field.
-
#options ⇒ Object
Returns the value of attribute options.
Attributes included from Facet
Instance Method Summary collapse
- #geo_distance ⇒ Object
-
#initialize(field, options = {}) ⇒ GeoDistance
constructor
A new instance of GeoDistance.
- #lat(lat) ⇒ Object
- #lon(lon) ⇒ Object
- #to_query_hash ⇒ Object
Methods included from Facet
included, #method_missing, #param, #scope
Methods included from Filter
Constructor Details
#initialize(field, options = {}) ⇒ GeoDistance
Returns a new instance of GeoDistance.
13 14 15 16 |
# File 'lib/eson/search/geo_distance.rb', line 13 def initialize(field, = {}) self.field = field self. = end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Eson::Search::Facet
Instance Attribute Details
#field ⇒ Object
Returns the value of attribute field.
11 12 13 |
# File 'lib/eson/search/geo_distance.rb', line 11 def field @field end |
#options ⇒ Object
Returns the value of attribute options.
11 12 13 |
# File 'lib/eson/search/geo_distance.rb', line 11 def @options end |
Instance Method Details
#geo_distance { ... } ⇒ self #geo_distance { ... } ⇒ self
9 |
# File 'lib/eson/search/geo_distance.rb', line 9 short_name :geo_distance |
#lat(lat) ⇒ Object
18 19 20 |
# File 'lib/eson/search/geo_distance.rb', line 18 def lat(lat) @lat = lat end |
#lon(lon) ⇒ Object
22 23 24 |
# File 'lib/eson/search/geo_distance.rb', line 22 def lon(lon) @lon = lon end |
#to_query_hash ⇒ Object
26 27 28 |
# File 'lib/eson/search/geo_distance.rb', line 26 def to_query_hash { name => .merge({ field => {:lat => @lat, :lon => @lon } }) } end |