Class: YahooWeather::Location
- Inherits:
-
Object
- Object
- YahooWeather::Location
- Defined in:
- lib/yahoo_weather/location.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
Instance Method Summary collapse
-
#initialize(payload) ⇒ Location
constructor
A new instance of Location.
Constructor Details
#initialize(payload) ⇒ Location
Returns a new instance of Location.
4 5 6 7 8 |
# File 'lib/yahoo_weather/location.rb', line 4 def initialize(payload) @city = payload['city'] @region = payload['region'] @country = payload['country'] end |
Instance Attribute Details
#city ⇒ Object (readonly)
Returns the value of attribute city.
2 3 4 |
# File 'lib/yahoo_weather/location.rb', line 2 def city @city end |
#country ⇒ Object (readonly)
Returns the value of attribute country.
2 3 4 |
# File 'lib/yahoo_weather/location.rb', line 2 def country @country end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
2 3 4 |
# File 'lib/yahoo_weather/location.rb', line 2 def region @region end |