Class: YahooWeather::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/yahoo-weather.rb

Overview

Describes a geographical location.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ Location

Returns a new instance of Location.



51
52
53
54
55
# File 'lib/yahoo-weather.rb', line 51

def initialize (payload)
  @city = payload['city']
  @country = payload['country']
  @region = payload['region']
end

Instance Attribute Details

#cityObject (readonly)

the name of the city.



43
44
45
# File 'lib/yahoo-weather.rb', line 43

def city
  @city
end

#countryObject (readonly)

the name of the country.



46
47
48
# File 'lib/yahoo-weather.rb', line 46

def country
  @country
end

#regionObject (readonly)

the name of the region, such as a state.



49
50
51
# File 'lib/yahoo-weather.rb', line 49

def region
  @region
end