Class: YahooWeather::Location
- Inherits:
-
Object
- Object
- YahooWeather::Location
- Defined in:
- lib/yahoo-weather.rb
Overview
Describes a geographical location.
Instance Attribute Summary collapse
-
#city ⇒ Object
readonly
the name of the city.
-
#country ⇒ Object
readonly
the name of the country.
-
#region ⇒ Object
readonly
the name of the region, such as a state.
Instance Method Summary collapse
-
#initialize(payload) ⇒ Location
constructor
A new instance of Location.
Constructor Details
#initialize(payload) ⇒ Location
Returns a new instance of Location.
51 52 53 54 55 |
# File 'lib/yahoo-weather.rb', line 51 def initialize (payload) @city = payload['city'] @country = payload['country'] @region = payload['region'] end |
Instance Attribute Details
#city ⇒ Object (readonly)
the name of the city.
43 44 45 |
# File 'lib/yahoo-weather.rb', line 43 def city @city end |
#country ⇒ Object (readonly)
the name of the country.
46 47 48 |
# File 'lib/yahoo-weather.rb', line 46 def country @country end |
#region ⇒ Object (readonly)
the name of the region, such as a state.
49 50 51 |
# File 'lib/yahoo-weather.rb', line 49 def region @region end |