Class: Tenkit::WeatherAlertCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/tenkit/weather_alert_collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#alertsObject (readonly)

Returns the value of attribute alerts.



5
6
7
# File 'lib/tenkit/weather_alert_collection.rb', line 5

def alerts
  @alerts
end

#details_urlObject (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