Class: Atig::OFilter::Geo
- Inherits:
-
Object
- Object
- Atig::OFilter::Geo
- Defined in:
- lib/atig/ofilter/geo.rb
Instance Method Summary collapse
- #call(q) ⇒ Object
-
#initialize(context) ⇒ Geo
constructor
A new instance of Geo.
Constructor Details
#initialize(context) ⇒ Geo
Returns a new instance of Geo.
6 7 8 |
# File 'lib/atig/ofilter/geo.rb', line 6 def initialize(context) @opts = context.opts end |
Instance Method Details
#call(q) ⇒ Object
10 11 12 13 14 |
# File 'lib/atig/ofilter/geo.rb', line 10 def call(q) return q unless @opts.ll lat, long = @opts.ll.split(",", 2) q.merge :lat => lat.to_f, :long => long.to_f end |