Sha256: f95540a9384a03a5eedf026f0eb9ba35a3db9fb771333b9940fdfb885e992b8d

Contents?: true

Size: 505 Bytes

Versions: 7

Compression:

Stored size: 505 Bytes

Contents

class BreatheIn::City
  attr_accessor :city_name, :zipcode, :today_high, :today_index, :last_update_time, :last_update_value, :last_update_index

  @@cities = []

  def initialize(city_hash={})
    city_hash.each { |key, value| self.send(("#{key}="), value) }
    @@cities << self
  end

  def add_city_air_quality(air_quality_hash)
    air_quality_hash.each { |key, value| self.send(("#{key}="), value) }
    self
  end

  def self.cities
    @@cities
  end

  def self.reset
    @@cities.clear
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
breathe_in-0.4.1 lib/breathe_in/city.rb
breathe_in-0.4.0 lib/breathe_in/city.rb
breathe_in-0.3.0 lib/breathe_in/city.rb
breathe_in-0.2.2 lib/breathe_in/city.rb
breathe_in-0.2.1 lib/breathe_in/city.rb
breathe_in-0.2.0 lib/breathe_in/city.rb
breathe_in-0.1.0 lib/breathe_in/city.rb