Class: Eson::Search::GeoBoundingBox
- Inherits:
-
Object
- Object
- Eson::Search::GeoBoundingBox
- Includes:
- Filter
- Defined in:
- lib/eson/search/geo_bounding_box.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
- #bottom_right(location, *args) ⇒ Object
-
#geo_bounding_box { ... } ⇒ self
Generates a ‘geo_bounding_box` filter in a filter context.
-
#initialize(field, options = {}) ⇒ GeoBoundingBox
constructor
A new instance of GeoBoundingBox.
- #to_query_hash ⇒ Object
- #top_left(location, *args) ⇒ Object
Methods included from Filter
Constructor Details
#initialize(field, options = {}) ⇒ GeoBoundingBox
Returns a new instance of GeoBoundingBox.
11 12 13 14 |
# File 'lib/eson/search/geo_bounding_box.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_bounding_box.rb', line 9 def field @field end |
#options ⇒ Object
Returns the value of attribute options.
9 10 11 |
# File 'lib/eson/search/geo_bounding_box.rb', line 9 def @options end |
Instance Method Details
#bottom_right(location, *args) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/eson/search/geo_bounding_box.rb', line 23 def bottom_right(location, *args) unless args.empty? location + args end [:bottom_right] = location end |
#geo_bounding_box { ... } ⇒ self
7 |
# File 'lib/eson/search/geo_bounding_box.rb', line 7 short_name :geo_bounding_box |
#to_query_hash ⇒ Object
30 31 32 |
# File 'lib/eson/search/geo_bounding_box.rb', line 30 def to_query_hash { name => {field => } } end |
#top_left(location, *args) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/eson/search/geo_bounding_box.rb', line 16 def top_left(location, *args) unless args.empty? location + args end [:top_left] = location end |