class DslrShop::Camera

Attributes

availability[RW]
brand[RW]
discount[RW]
name[RW]
price[RW]
rewards[RW]
style[RW]
type[RW]
url[RW]

Public Class Methods

all() click to toggle source
# File lib/dslr_shop/camera.rb, line 6
def self.all
  @@all
end
new(brand = nil, name = nil, availability = nil, price = nil, url = nil) click to toggle source
# File lib/dslr_shop/camera.rb, line 10
def initialize(brand = nil, name = nil, availability = nil, price = nil, url = nil)
  @brand = brand
  @name = name
  @availability = availability
  @price = price
  @url = url
  @@all << self
end

Public Instance Methods

add_attributes() click to toggle source

def self.create_from_collection(camera_collection)

# camera_collection=> array of camera_hashes
camera_collection.each {|camera_hash|
  self.new(camera_hash)
}

end

# File lib/dslr_shop/camera.rb, line 26
def add_attributes
  DslrShop::Scraper.scrape_from_detail(self)
end