Class: Yweather::Location

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#cityObject (readonly)

Returns the value of attribute city.



4
5
6
# File 'lib/yweather/location.rb', line 4

def city
  @city
end

#countryObject (readonly)

Returns the value of attribute country.



5
6
7
# File 'lib/yweather/location.rb', line 5

def country
  @country
end

#regionObject (readonly)

Returns the value of attribute region.



6
7
8
# File 'lib/yweather/location.rb', line 6

def region
  @region
end