Class: DarkSky::Location::Day
- Inherits:
-
CommonMethods
- Object
- CommonMethods
- DarkSky::Location::Day
- Defined in:
- lib/darksky-api/day.rb
Instance Method Summary collapse
-
#apparent_temperature_high ⇒ Numeric
(also: #high_apparent_temperature, #apparent_high_temperature, #high_feels_like, #feels_like_high, #high_heat_index, #heat_index_high, #high_wind_chill, #wind_chill_high)
High feels like on day.
-
#apparent_temperature_high_time ⇒ Time
(also: #high_apparent_temperature_time, #apparent_high_temperature_time, #high_feels_like_time, #feels_like_high_time, #high_heat_index_time, #heat_index_high_time, #high_wind_chill_time, #wind_chill_high_time)
Time of high apparent temperature.
-
#apparent_temperature_low ⇒ Numeric
(also: #low_apparent_temperature, #apparent_low_temperature, #low_feels_like, #feels_like_low, #low_heat_index, #heat_index_low, #low_wind_chill, #wind_chill_low)
Low feels like on day.
-
#apparent_temperature_low_time ⇒ Time
(also: #low_apparent_temperature_time, #apparent_low_temperature_time, #low_feels_like_time, #feels_like_low_time, #low_heat_index_time, #heat_index_low_time, #low_wind_chill_time, #wind_chill_low_time)
Time of low apparent temperature.
-
#date ⇒ Date
Object for the day.
-
#initialize(location, days_from_current) ⇒ Day
constructor
automatically called by
Location
. -
#moon_phase ⇒ Numeric
Phase of the moon (0 to 1).
-
#moon_phase_text ⇒ String
Textual representation of moon phase.
-
#precip_accumulation ⇒ Numeric
Precipitation accumulation on day.
-
#precip_intensity_max ⇒ Numeric
Maximum precipitation intensity on day.
-
#precip_intensity_max_text ⇒ String
Text representation of maximum precipitation intensity on day.
-
#precip_intensity_max_time ⇒ Time
Time of maximum precipitation intensity.
-
#sunrise_time ⇒ Time
(also: #sunrise)
Object with sunrise timestamp.
-
#sunset_time ⇒ Time
(also: #sunset)
Object with sunset timestamp.
-
#temperature_high ⇒ Numeric
(also: #high_temperature)
High temperature for the day.
-
#temperature_high_time ⇒ Time
(also: #high_temperature_time)
Time of high temperature.
-
#temperature_low ⇒ Numeric
(also: #low_temperature)
Low temperature for the day.
-
#temperature_low_time ⇒ Time
(also: #low_temperature_time)
Time of low temperature.
-
#uv_index_time ⇒ Time
Max UV index time on day.
-
#wind_gust_time ⇒ Time
Wind gust time on day.
Methods inherited from CommonMethods
#apparent_temperature, #clear?, #cloud_cover, #cloudy?, #dew_point, #foggy?, #humidity, #icon, #ozone, #precip_intensity, #precip_intensity_text, #precip_probability, #precip_type, #pressure, #rainy?, #sleet?, #snowy?, #summary, #uv_index, #visibility, #wind_bearing, #wind_bearing_text, #wind_gust, #wind_speed, #windy?
Constructor Details
#initialize(location, days_from_current) ⇒ Day
automatically called by Location
7 8 9 10 |
# File 'lib/darksky-api/day.rb', line 7 def initialize(location, days_from_current) @location = location @days_from_current = days_from_current end |
Instance Method Details
#apparent_temperature_high ⇒ Numeric Also known as: high_apparent_temperature, apparent_high_temperature, high_feels_like, feels_like_high, high_heat_index, heat_index_high, high_wind_chill, wind_chill_high
Returns high feels like on day.
142 143 144 |
# File 'lib/darksky-api/day.rb', line 142 def apparent_temperature_high data[:apparentTemperatureHigh] end |
#apparent_temperature_high_time ⇒ Time Also known as: high_apparent_temperature_time, apparent_high_temperature_time, high_feels_like_time, feels_like_high_time, high_heat_index_time, heat_index_high_time, high_wind_chill_time, wind_chill_high_time
Returns time of high apparent temperature.
176 177 178 |
# File 'lib/darksky-api/day.rb', line 176 def apparent_temperature_high_time Time.at data[:apparentTemperatureHighTime] end |
#apparent_temperature_low ⇒ Numeric Also known as: low_apparent_temperature, apparent_low_temperature, low_feels_like, feels_like_low, low_heat_index, heat_index_low, low_wind_chill, wind_chill_low
Returns low feels like on day.
159 160 161 |
# File 'lib/darksky-api/day.rb', line 159 def apparent_temperature_low data[:apparentTemperatureLow] end |
#apparent_temperature_low_time ⇒ Time Also known as: low_apparent_temperature_time, apparent_low_temperature_time, low_feels_like_time, feels_like_low_time, low_heat_index_time, heat_index_low_time, low_wind_chill_time, wind_chill_low_time
Returns time of low apparent temperature.
193 194 195 |
# File 'lib/darksky-api/day.rb', line 193 def apparent_temperature_low_time Time.at data[:apparentTemperatureLowTime] end |
#date ⇒ Date
Returns object for the day.
17 18 19 20 |
# File 'lib/darksky-api/day.rb', line 17 def date # we only want the date, so don't use `Time.at()` Date.strptime data[:time].to_s, '%s' end |
#moon_phase ⇒ Numeric
Returns phase of the moon (0 to 1).
87 88 89 |
# File 'lib/darksky-api/day.rb', line 87 def moon_phase data[:moonPhase] end |
#moon_phase_text ⇒ String
Returns textual representation of moon phase.
96 97 98 99 |
# File 'lib/darksky-api/day.rb', line 96 def moon_phase_text # separate method for easy unit testing _moon_phase_text(moon_phase) end |
#precip_accumulation ⇒ Numeric
Returns precipitation accumulation on day.
133 134 135 |
# File 'lib/darksky-api/day.rb', line 133 def precip_accumulation data[:precipAccumulation] end |
#precip_intensity_max ⇒ Numeric
Returns maximum precipitation intensity on day.
106 107 108 |
# File 'lib/darksky-api/day.rb', line 106 def precip_intensity_max data[:precipIntensityMax] end |
#precip_intensity_max_text ⇒ String
Returns text representation of maximum precipitation intensity on day.
115 116 117 |
# File 'lib/darksky-api/day.rb', line 115 def precip_intensity_max_text _precip_intensity_text(precip_intensity_max) end |
#precip_intensity_max_time ⇒ Time
Returns time of maximum precipitation intensity.
124 125 126 |
# File 'lib/darksky-api/day.rb', line 124 def precip_intensity_max_time Time.at data[:precipIntensityMaxTime] if data[:precipIntensityMaxTime] end |
#sunrise_time ⇒ Time Also known as: sunrise
Returns object with sunrise timestamp.
67 68 69 |
# File 'lib/darksky-api/day.rb', line 67 def sunrise_time Time.at data[:sunriseTime] end |
#sunset_time ⇒ Time Also known as: sunset
Returns object with sunset timestamp.
77 78 79 |
# File 'lib/darksky-api/day.rb', line 77 def sunset_time Time.at data[:sunsetTime] end |
#temperature_high ⇒ Numeric Also known as: high_temperature
Returns high temperature for the day.
27 28 29 |
# File 'lib/darksky-api/day.rb', line 27 def temperature_high data[:temperatureHigh] end |
#temperature_high_time ⇒ Time Also known as: high_temperature_time
Returns time of high temperature.
37 38 39 |
# File 'lib/darksky-api/day.rb', line 37 def temperature_high_time Time.at data[:temperatureHighTime] end |
#temperature_low ⇒ Numeric Also known as: low_temperature
Returns low temperature for the day.
47 48 49 |
# File 'lib/darksky-api/day.rb', line 47 def temperature_low data[:temperatureLow] end |
#temperature_low_time ⇒ Time Also known as: low_temperature_time
Returns time of low temperature.
57 58 59 |
# File 'lib/darksky-api/day.rb', line 57 def temperature_low_time Time.at data[:temperatureLowTime] end |
#uv_index_time ⇒ Time
Returns max UV index time on day.
219 220 221 |
# File 'lib/darksky-api/day.rb', line 219 def uv_index_time Time.at data[:uvIndexTime] end |
#wind_gust_time ⇒ Time
Returns wind gust time on day.
210 211 212 |
# File 'lib/darksky-api/day.rb', line 210 def wind_gust_time Time.at data[:windGustTime] end |