Class: YahooWeather::Location
- Inherits:
-
Object
- Object
- YahooWeather::Location
- Defined in:
- lib/yahoo-weather/location.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.
12 13 14 15 16 |
# File 'lib/yahoo-weather/location.rb', line 12 def initialize (payload) @city = payload['city'] @country = payload['country'] @region = payload['region'] end |
Instance Attribute Details
#city ⇒ Object (readonly)
the name of the city.
4 5 6 |
# File 'lib/yahoo-weather/location.rb', line 4 def city @city end |
#country ⇒ Object (readonly)
the name of the country.
7 8 9 |
# File 'lib/yahoo-weather/location.rb', line 7 def country @country end |
#region ⇒ Object (readonly)
the name of the region, such as a state.
10 11 12 |
# File 'lib/yahoo-weather/location.rb', line 10 def region @region end |