Module: OpenWeather::Endpoints::OneCall
- Included in:
- Client
- Defined in:
- lib/open_weather/endpoints/one_call.rb
Instance Method Summary collapse
Instance Method Details
#one_call(lat, lon = nil, options = {}) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/open_weather/endpoints/one_call.rb', line 6 def one_call(lat, lon = nil, = {}) = lat.is_a?(Hash) ? .merge(lat) : .merge(lat: lat, lon: lon) [:exclude] = [:exclude].join(',') if [:exclude].is_a?(Array) [:dt] = [:dt].to_i if [:dt].is_a?(Time) path = .key?(:dt) ? '3.0/onecall/timemachine' : '3.0/onecall' OpenWeather::Models::OneCall::Weather.new(get(path, ), ) end |