Class: Yweather::Location
- Inherits:
-
Object
- Object
- Yweather::Location
- Defined in:
- lib/yweather/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(data) ⇒ Location
constructor
A new instance of Location.
Constructor Details
#initialize(data) ⇒ Location
Returns a new instance of Location.
8 9 10 11 12 |
# File 'lib/yweather/location.rb', line 8 def initialize(data) @city = data[:city] @country = data[:country] @region = data[:region] end |
Instance Attribute Details
#city ⇒ Object (readonly)
Returns the value of attribute city.
4 5 6 |
# File 'lib/yweather/location.rb', line 4 def city @city end |
#country ⇒ Object (readonly)
Returns the value of attribute country.
5 6 7 |
# File 'lib/yweather/location.rb', line 5 def country @country end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
6 7 8 |
# File 'lib/yweather/location.rb', line 6 def region @region end |