Sha256: 4498da6d69fabf8781f9dfd8e7c7874aee97077faefcd0cb25f6cea7cc6e353d

Contents?: true

Size: 425 Bytes

Versions: 2

Compression:

Stored size: 425 Bytes

Contents

class City
  attr_accessor :name, :state, :city_url
  attr_reader :items

  @@all = []

  def initialize(city_attributes)
    city_attributes.each {|key, value| self.send(("#{key}="), value)}
    @items = []
    @@all << self
  end

  def add_item(item)
    item.city = self
    @items << item
    item
  end

  def get_apple_prods_by_price(set_price)
    @items.select { |item| item.price.to_i >= set_price.to_i }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
applephile-0.1.1 lib/city.rb
applephile-0.1.0 lib/city.rb