Class: Barometer::WeatherService::Base
- Inherits:
-
Object
- Object
- Barometer::WeatherService::Base
- Defined in:
- lib/barometer/weather_services/base.rb
Instance Method Summary collapse
-
#initialize(source, version = nil) ⇒ Base
constructor
A new instance of Base.
- #measure(query, options = {}) ⇒ Object
Constructor Details
#initialize(source, version = nil) ⇒ Base
Returns a new instance of Base.
4 5 6 7 |
# File 'lib/barometer/weather_services/base.rb', line 4 def initialize(source, version=nil) @source = source @service = WeatherService.source(@source, version) end |
Instance Method Details
#measure(query, options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/barometer/weather_services/base.rb', line 9 def measure(query, ={}) @response = Barometer::Response.new record_time do measure_and_record_status(query, ) end @response.weight = .fetch(:weight, nil) @response.source = @source @response end |