-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exposed the national weather alerts response in the One Call API (#25)
* Added alerts to the one_call API response. * Update change log and readme. * Added alerts to the one_call spec Added national alerts section to VCR fixture. Added check for each alert field value. * Fixed formatting in CHANGELOG and removed superfluous Alert constructor. * Rerecorded the lat_lon spec with a location that has current alerts and updated expectations to match. * Added alerts to the one_call API response. * Update change log and readme. * Added alerts to the one_call spec Added national alerts section to VCR fixture. Added check for each alert field value. * Fixed formatting in CHANGELOG and removed superfluous Alert constructor. * Rerecorded the lat_lon spec with a location that has current alerts and updated expectations to match. * Removed extra change long entry * DRY'd up alert spec a bit.
- Loading branch information
Showing
7 changed files
with
131 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
module OpenWeather | ||
module Models | ||
module OneCall | ||
class Alert < Model | ||
property 'sender_name' | ||
property 'event' | ||
property 'start', transform_with: ->(v) { Time.at(v).utc } # UTC | ||
property 'end', transform_with: ->(v) { Time.at(v).utc } # UTC | ||
property 'description' | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters