Class: Barometer::Utils::Api
- Inherits:
-
Object
- Object
- Barometer::Utils::Api
- Defined in:
- lib/barometer/utils/api.rb
Direct Known Subclasses
Query::Service::GeonamesTimezone::Api, Query::Service::GoogleGeocode::Api, Query::Service::NoaaStation::Api, Query::Service::WeatherId::Api, Query::Service::WundergroundTimezone::Api, Query::Service::YahooPlacefinder::Api, Query::Service::YahooWeather::Api, WeatherService::WundergroundV1::CurrentApi, WeatherService::WundergroundV1::ForecastApi
Instance Attribute Summary collapse
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
- #current_query ⇒ Object
- #get ⇒ Object
-
#initialize(query) ⇒ Api
constructor
A new instance of Api.
- #params ⇒ Object
- #unwrap_nodes ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(query) ⇒ Api
Returns a new instance of Api.
6 7 8 |
# File 'lib/barometer/utils/api.rb', line 6 def initialize(query) @query = query end |
Instance Attribute Details
#query ⇒ Object (readonly)
Returns the value of attribute query.
4 5 6 |
# File 'lib/barometer/utils/api.rb', line 4 def query @query end |
Instance Method Details
#current_query ⇒ Object
10 11 12 |
# File 'lib/barometer/utils/api.rb', line 10 def current_query @query.converted_query if @query.respond_to?(:converted_query) end |
#get ⇒ Object
25 26 27 |
# File 'lib/barometer/utils/api.rb', line 25 def get Utils::PayloadRequest.new(self).get end |
#params ⇒ Object
17 18 19 |
# File 'lib/barometer/utils/api.rb', line 17 def params @query.to_param end |
#unwrap_nodes ⇒ Object
21 22 23 |
# File 'lib/barometer/utils/api.rb', line 21 def unwrap_nodes [] end |
#url ⇒ Object
14 15 |
# File 'lib/barometer/utils/api.rb', line 14 def url end |