Class: TodoStore

Inherits:
Object
  • Object
show all
Defined in:
lib/todo_store.rb

Instance Method Summary collapse

Constructor Details

#initializeTodoStore

Returns a new instance of TodoStore.



7
8
9
# File 'lib/todo_store.rb', line 7

def initialize
  read
end

Instance Method Details

#save(todo) ⇒ Object



21
22
23
24
# File 'lib/todo_store.rb', line 21

def save(todo)
  @list.add(todo)
  write
end

#todosObject



11
12
13
# File 'lib/todo_store.rb', line 11

def todos
  @list
end

#update(todo) ⇒ Object



15
16
17
18
19
# File 'lib/todo_store.rb', line 15

def update(todo)
  @list.delete(todo)
  @list.add(todo)
  write
end