class Applephile::City

Attributes

city_url[RW]
items[R]
name[RW]
state[RW]

Public Class Methods

new(city_attributes) click to toggle source
# File lib/applephile/city.rb, line 8
def initialize(city_attributes)
  city_attributes.each {|key, value| self.send(("#{key}="), value)}
  @items = []
  @@all << self
end

Public Instance Methods

add_item(item) click to toggle source
# File lib/applephile/city.rb, line 14
def add_item(item)
  item.city = self
  @items << item
  item
end
get_apple_prods_by_price(set_price) click to toggle source
# File lib/applephile/city.rb, line 20
def get_apple_prods_by_price(set_price)
  @items.select { |item| item.price.to_i >= set_price.to_i }
end