Class: Eson::Search::GeoDistanceRange
- Inherits:
-
Object
- Object
- Eson::Search::GeoDistanceRange
- Includes:
- Filter
- Defined in:
- lib/eson/search/geo_distance_range.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
Returns the value of attribute field.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#geo_distance_range { ... } ⇒ self
Generates a ‘geo_distance_range` filter in a filter context.
-
#initialize(field, options = {}) ⇒ GeoDistanceRange
constructor
A new instance of GeoDistanceRange.
- #lat(lat) ⇒ Object
- #lon(lon) ⇒ Object
- #to_query_hash ⇒ Object
Methods included from Filter
Constructor Details
#initialize(field, options = {}) ⇒ GeoDistanceRange
Returns a new instance of GeoDistanceRange.
11 12 13 14 |
# File 'lib/eson/search/geo_distance_range.rb', line 11 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::Filter
Instance Attribute Details
#field ⇒ Object
Returns the value of attribute field.
9 10 11 |
# File 'lib/eson/search/geo_distance_range.rb', line 9 def field @field end |
#options ⇒ Object
Returns the value of attribute options.
9 10 11 |
# File 'lib/eson/search/geo_distance_range.rb', line 9 def @options end |
Instance Method Details
#geo_distance_range { ... } ⇒ self
7 |
# File 'lib/eson/search/geo_distance_range.rb', line 7 short_name :geo_distance_range |
#lat(lat) ⇒ Object
16 17 18 |
# File 'lib/eson/search/geo_distance_range.rb', line 16 def lat(lat) @lat = lat end |
#lon(lon) ⇒ Object
20 21 22 |
# File 'lib/eson/search/geo_distance_range.rb', line 20 def lon(lon) @lon = lon end |
#to_query_hash ⇒ Object
24 25 26 |
# File 'lib/eson/search/geo_distance_range.rb', line 24 def to_query_hash { name => .merge({ field => {:lat => @lat, :lon => @lon } }) } end |