Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TodoList
- attr_reader :title, :items
- def initialize(list_title)
- @title = list_title
- @items = Array.new
- end
- def add_item(new_item)
- new_item = Item.new(new_item)
- @items.push(new_item)
- end
- def delete_item(item) ######## Doesn't work. It just do nothing.
- @items.delete(item)
- end
- end
- class Item
- attr_reader :description, :completed_status
- def initialize(item_description)
- @description = item_description
- @completed_status = false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement