Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrates to One Call 3.0 API #38

Merged
merged 4 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading