Class: YahooWeather::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/yahoo_weather/location.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#cityObject (readonly)

Returns the value of attribute city.



2
3
4
# File 'lib/yahoo_weather/location.rb', line 2

def city
  @city
end

#countryObject (readonly)

Returns the value of attribute country.



2
3
4
# File 'lib/yahoo_weather/location.rb', line 2

def country
  @country
end

#regionObject (readonly)

Returns the value of attribute region.



2
3
4
# File 'lib/yahoo_weather/location.rb', line 2

def region
  @region
end