Class: WeatherHacks::ForecastMap::Pref

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Pref

Returns a new instance of Pref.



21
22
23
24
# File 'lib/weatherhacks.rb', line 21

def initialize(name)
  @name = name
  @cities = []
end

Instance Attribute Details

#citiesObject (readonly)

Returns the value of attribute cities.



20
21
22
# File 'lib/weatherhacks.rb', line 20

def cities
  @cities
end

#nameObject (readonly)

Returns the value of attribute name.



20
21
22
# File 'lib/weatherhacks.rb', line 20

def name
  @name
end

Instance Method Details

#city(name, id, rss) ⇒ Object



26
27
28
29
30
# File 'lib/weatherhacks.rb', line 26

def city(name, id, rss)
  city = City.new(name, id, rss)
  @cities << city
  CITY[city.name] = city
end