Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.48 KB | None | 0 0
  1. class TodoList
  2.     attr_reader :title, :items
  3.     def initialize(list_title)
  4.         @title = list_title
  5.         @items = Array.new
  6.     end
  7.    
  8.     def add_item(new_item)
  9.         new_item = Item.new(new_item)
  10.         @items.push(new_item)
  11.     end
  12.     def delete_item(item) ######## Doesn't work. It just do nothing.
  13.         @items.delete(item)
  14.     end
  15. end
  16.  
  17. class Item
  18.     attr_reader :description, :completed_status
  19.  
  20.     def initialize(item_description)
  21.         @description = item_description
  22.         @completed_status = false
  23.     end
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement