Class: YahooWeather::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/yahoo-weather/location.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.



12
13
14
15
16
# File 'lib/yahoo-weather/location.rb', line 12

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

Instance Attribute Details

#cityObject (readonly)

the name of the city.



4
5
6
# File 'lib/yahoo-weather/location.rb', line 4

def city
  @city
end

#countryObject (readonly)

the name of the country.



7
8
9
# File 'lib/yahoo-weather/location.rb', line 7

def country
  @country
end

#regionObject (readonly)

the name of the region, such as a state.



10
11
12
# File 'lib/yahoo-weather/location.rb', line 10

def region
  @region
end