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