class StellingBanjos::Banjos

Attributes

name[RW]
price[RW]
sold_out[RW]

Public Class Methods

all() click to toggle source
# File lib/stelling_banjos/banjos.rb, line 31
def self.all
  @@all
end
create_from_catalog(array) click to toggle source
# File lib/stelling_banjos/banjos.rb, line 14
def self.create_from_catalog(array)
  array.each do |hash|
    self.new(hash[:name], hash[:price], hash[:link], hash[:sold_out])
  end
end
new(name, price, link, sold_out) click to toggle source
# File lib/stelling_banjos/banjos.rb, line 6
def initialize(name, price, link, sold_out)
  @name = name
  @price = price
  @link = link
  @sold_out = sold_out
  @@all << self
end

Public Instance Methods

sold_out?() click to toggle source
# File lib/stelling_banjos/banjos.rb, line 20
def sold_out?
  case @sold_out
  when "Yes"
    return true
  when "No"
    return false
  else
    return false
  end
end