Created
July 29, 2012 21:15
-
-
Save chadjemmett/3201869 to your computer and use it in GitHub Desktop.
How to store objects with multiple variables.
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
class Todo | |
attr_accessor :item, :done, :time_created | |
def initialize item_name | |
#what we need for a new item on the todo list. | |
#when the item was created.(optional) | |
@time_created = Time.now | |
#the string that is displayed that's identified. | |
@item = item_name | |
#whether it's done or not | |
@done = false | |
end #of initialize method. | |
end # of todo class. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment