Skip to content

Instantly share code, notes, and snippets.

@BrianJoyce
Created October 13, 2012 08:29
Show Gist options
  • Save BrianJoyce/3883819 to your computer and use it in GitHub Desktop.
Save BrianJoyce/3883819 to your computer and use it in GitHub Desktop.
cookies and ovens
class Oven
def initialize
end
def heat(temperature=350)
temperature
end
def has_batch?
end
end
class Cookies
attr_accessor :ingredients
def initialize
@status = [:doughy, :almost_ready, :ready, :burned]
@ingredients = {:butter => "100 grams", :caster_sugar => "60 grams", :egg => "1"}
end
end
class Batch < Cookies
attr_reader :num_cookies, :batch_of_cookies
def initialize
@batch_of_cookies = 25.times do |x|
x = Cookies.new
puts x.inspect
end
end
def cook_time(oven_time = 50)
oven_time
end
end
batch_1 = Batch.new
puts batch_1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment