Skip to content

Instantly share code, notes, and snippets.

@townie
Created May 20, 2014 20:20
Show Gist options
  • Save townie/974655ffc5d77f1d82f3 to your computer and use it in GitHub Desktop.
Save townie/974655ffc5d77f1d82f3 to your computer and use it in GitHub Desktop.
doug gist
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