-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Exposed the national weather alerts response in the One Call API #25
Changes from 3 commits
ce964b1
9e21ab6
5c434d8
fe9321c
c596d08
b084339
8f713f9
1e3b6e5
9c2c71e
46f4c4c
bab735b
6be27da
6e7fd9d
672b548
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# 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' | ||
|
||
def initialize(args = nil, options = {}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't need to override the constructor unless you're doing something extra here. Just remove it. |
||
super args, options | ||
end | ||
end | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,7 +95,10 @@ http_interactions: | |
rain","icon":"10d"}],"clouds":99,"rain":8.01,"uvi":10.95},{"dt":1589824800,"sunrise":1589800419,"sunset":1589850710,"temp":{"day":298.65,"min":289.07,"max":300.81,"night":289.49,"eve":297.92,"morn":289.07},"feels_like":{"day":298.14,"night":288.35,"eve":298.74,"morn":288.15},"pressure":1015,"humidity":56,"dew_point":289.47,"wind_speed":3.6,"wind_deg":21,"weather":[{"id":802,"main":"Clouds","description":"scattered | ||
clouds","icon":"03d"}],"clouds":49,"uvi":10.91},{"dt":1589911200,"sunrise":1589886783,"sunset":1589937154,"temp":{"day":296.27,"min":286.83,"max":298.28,"night":288.9,"eve":297.35,"morn":286.83},"feels_like":{"day":295.57,"night":288.28,"eve":299.19,"morn":286.03},"pressure":1015,"humidity":56,"dew_point":287.09,"wind_speed":2.73,"wind_deg":40,"weather":[{"id":800,"main":"Clear","description":"clear | ||
sky","icon":"01d"}],"clouds":0,"uvi":10.01},{"dt":1589997600,"sunrise":1589973148,"sunset":1590023597,"temp":{"day":298.21,"min":287.71,"max":299.71,"night":290.03,"eve":298.59,"morn":287.71},"feels_like":{"day":299.68,"night":289.89,"eve":301.62,"morn":287.74},"pressure":1014,"humidity":61,"dew_point":290.18,"wind_speed":1.3,"wind_deg":71,"weather":[{"id":800,"main":"Clear","description":"clear | ||
sky","icon":"01d"}],"clouds":0,"uvi":10.16}]}' | ||
sky","icon":"01d"}],"clouds":0,"uvi":10.16}],"alerts": [{"sender_name": "NWS Tulsa (Eastern Oklahoma)","event": "Heat Advisory","start": 1597341600,"end": 1597366800,"description": "...HEAT ADVISORY REMAINS IN EFFECT FROM 1 PM THIS AFTERNOON TO\n8 PM CDT THIS EVENING...\n* WHAT...Heat index values of 105 to 109 degrees expected.\n* WHERE...Creek, Okfuskee, Okmulgee, McIntosh, Pittsburg,\nLatimer, Pushmataha, and Choctaw Counties.\n* WHEN...From 1 PM to 8 PM CDT Thursday.\n* IMPACTS...The combination of hot temperatures and high\nhumidity will combine to create a dangerous situation in which\nheat illnesses are possible."}]}' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We usually don't hand-craft VCR-recorded data. You should record a new separate VCR K7 .yml that has alerts data and write a separate unit test for that. |
||
http_version: null | ||
recorded_at: Thu, 14 May 2020 03:09:08 GMT | ||
recorded_with: VCR 5.1.0 | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the format and danger will stop complaining. Missing a
-
, a period and a PR link in front.