Created
October 13, 2012 08:29
-
-
Save BrianJoyce/3883819 to your computer and use it in GitHub Desktop.
cookies and ovens
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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