Created
May 20, 2014 20:20
-
-
Save townie/974655ffc5d77f1d82f3 to your computer and use it in GitHub Desktop.
doug gist
This file contains 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
string = ['12 oz pepper' , 'One can of tomatoes' ] | |
class LineItem | |
attr_accessor :a,:u,:i | |
def initialize(a, u, i) | |
@a= a | |
@u = u | |
@i = i | |
end | |
end | |
class Recipe | |
attr_accessor :array | |
def initialize(a, i = []) | |
@array= a | |
@ingredients = i | |
end | |
def parse | |
@array.each do |string| | |
until string.empty? | |
a = string | |
end | |
i << LineItem.new(a, u, i) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment