class WeatherGov::ForecastPeriod

Attributes

data[R]

Public Class Methods

new(data:) click to toggle source
# File lib/weather_gov/forecast_period.rb, line 7
def initialize(data:)
  @data = data
end

Public Instance Methods

daytime?() click to toggle source
# File lib/weather_gov/forecast_period.rb, line 27
def daytime?
  data.fetch("isDaytime")
end
detailed_forecast() click to toggle source
# File lib/weather_gov/forecast_period.rb, line 59
def detailed_forecast
  data.fetch("detailedForecast")
end
end_time() click to toggle source
# File lib/weather_gov/forecast_period.rb, line 23
def end_time
  @end_time ||= Time.parse(data.fetch("endTime"))
end
icon() click to toggle source
# File lib/weather_gov/forecast_period.rb, line 51
def icon
  data.fetch("icon")
end
name() click to toggle source
# File lib/weather_gov/forecast_period.rb, line 15
def name
  data.fetch("name")
end
number() click to toggle source
# File lib/weather_gov/forecast_period.rb, line 11
def number
  data.fetch("number")
end
short_forecast() click to toggle source
# File lib/weather_gov/forecast_period.rb, line 55
def short_forecast
  data.fetch("shortForecast")
end
start_time() click to toggle source
# File lib/weather_gov/forecast_period.rb, line 19
def start_time
  @start_time ||= Time.parse(data.fetch("startTime"))
end
temperature() click to toggle source
# File lib/weather_gov/forecast_period.rb, line 31
def temperature
  data.fetch("temperature")
end
temperature_trend() click to toggle source
# File lib/weather_gov/forecast_period.rb, line 39
def temperature_trend
  data.fetch("temperatureTrend")
end
temperature_unit() click to toggle source
# File lib/weather_gov/forecast_period.rb, line 35
def temperature_unit
  data.fetch("temperatureUnit")
end
wind_direction() click to toggle source
# File lib/weather_gov/forecast_period.rb, line 47
def wind_direction
  data.fetch("windDirection")
end
wind_speed() click to toggle source
# File lib/weather_gov/forecast_period.rb, line 43
def wind_speed
  data.fetch("windSpeed")
end