Skip to content

Commit

Permalink
Migrates to One Call 3.0 API (dblock#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanmartin authored Jul 2, 2024
1 parent 01fbc68 commit be6d875
Show file tree
Hide file tree
Showing 8 changed files with 283 additions and 277 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### 0.4.1 (Next)
### 0.5.0 (Next)

* [#25](https://github.com/dblock/open-weather-ruby-client/pull/25): Exposed the national weather alerts response in the One Call API - [@troya2](https://github.com/troya2).
* [#38](https://github.com/dblock/open-weather-ruby-client/pull/38): Migrated to One Call 3.0 API - [@jeanmartin](https://github.com/jeanmartin).
* Your contribution here.

### 0.4.0 (2023/08/13)
Expand Down
2 changes: 1 addition & 1 deletion lib/open_weather/endpoints/one_call.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def one_call(lat, lon = nil, options = {})
options = lat.is_a?(Hash) ? options.merge(lat) : options.merge(lat: lat, lon: lon)
options[:exclude] = options[:exclude].join(',') if options[:exclude].is_a?(Array)
options[:dt] = options[:dt].to_i if options[:dt].is_a?(Time)
path = options.key?(:dt) ? '2.5/onecall/timemachine' : '2.5/onecall'
path = options.key?(:dt) ? '3.0/onecall/timemachine' : '3.0/onecall'
OpenWeather::Models::OneCall::Weather.new(get(path, options), options)
end
end
Expand Down
1 change: 1 addition & 0 deletions lib/open_weather/models/one_call/daily_weather.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class DailyWeather < Model
property 'rain' # precipitation volume, mm
property 'snow' # snow volume, mm
property 'weather'
property 'summary'

def initialize(args = nil, options = {})
super args, options
Expand Down
2 changes: 1 addition & 1 deletion lib/open_weather/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module OpenWeather
VERSION = '0.4.1'
VERSION = '0.5.0'
end
85 changes: 43 additions & 42 deletions spec/fixtures/open_weather/one_call/error_out_of_range.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

233 changes: 117 additions & 116 deletions spec/fixtures/open_weather/one_call/lat_lon.yml

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit be6d875

Please sign in to comment.