Class: Tenkit::WeatherAlertCollection
- Inherits:
-
Object
- Object
- Tenkit::WeatherAlertCollection
- Defined in:
- lib/tenkit/weather_alert_collection.rb
Instance Attribute Summary collapse
-
#alerts ⇒ Object
readonly
Returns the value of attribute alerts.
-
#details_url ⇒ Object
readonly
Returns the value of attribute details_url.
Instance Method Summary collapse
-
#initialize(weather_alerts) ⇒ WeatherAlertCollection
constructor
A new instance of WeatherAlertCollection.
Constructor Details
#initialize(weather_alerts) ⇒ WeatherAlertCollection
7 8 9 10 11 12 |
# File 'lib/tenkit/weather_alert_collection.rb', line 7 def initialize(weather_alerts) return if weather_alerts.nil? @alerts = weather_alerts['alerts'].map { |alert| WeatherAlertSummary.new(alert) } @details_url = weather_alerts['detailsUrl'] end |
Instance Attribute Details
#alerts ⇒ Object (readonly)
Returns the value of attribute alerts.
5 6 7 |
# File 'lib/tenkit/weather_alert_collection.rb', line 5 def alerts @alerts end |
#details_url ⇒ Object (readonly)
Returns the value of attribute details_url.
5 6 7 |
# File 'lib/tenkit/weather_alert_collection.rb', line 5 def details_url @details_url end |