Class: DarkSky::Location::Current
- Inherits:
-
CommonMethods
- Object
- CommonMethods
- DarkSky::Location::Current
- Defined in:
- lib/darksky-api/current.rb
Instance Method Summary collapse
-
#initialize(location) ⇒ Current
constructor
automatically called by
Location
. -
#nearest_storm_bearing ⇒ Numeric
Nearest storm bearing at location.
-
#nearest_storm_bearing_text ⇒ String
Text representation of bearing.
-
#nearest_storm_distance ⇒ Numeric
Nearest storm distance from location.
-
#temperature ⇒ Numeric
Current temperature at location.
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) ⇒ Current
automatically called by Location
7 8 9 |
# File 'lib/darksky-api/current.rb', line 7 def initialize(location) @location = location end |
Instance Method Details
#nearest_storm_bearing ⇒ Numeric
Returns nearest storm bearing at location.
16 17 18 |
# File 'lib/darksky-api/current.rb', line 16 def nearest_storm_bearing data[:nearestStormBearing] end |
#nearest_storm_bearing_text ⇒ String
Returns text representation of bearing.
25 26 27 |
# File 'lib/darksky-api/current.rb', line 25 def nearest_storm_bearing_text _bearing_text(nearest_storm_bearing) end |
#nearest_storm_distance ⇒ Numeric
Returns nearest storm distance from location.
34 35 36 |
# File 'lib/darksky-api/current.rb', line 34 def nearest_storm_distance data[:nearestStormDistance] end |
#temperature ⇒ Numeric
Returns current temperature at location.
43 44 45 |
# File 'lib/darksky-api/current.rb', line 43 def temperature data[:temperature] end |