Module: Brute::Store::TodoStore

Defined in:
lib/brute/store/todo_store.rb

Overview

In-memory todo list storage. The agent uses this to track multi-step tasks. The list is replaced wholesale on each todo_write call.

Class Method Summary collapse

Class Method Details

.allObject

Return all current items.



19
20
21
# File 'lib/brute/store/todo_store.rb', line 19

def all
  @mutex.synchronize { @items.dup }
end

.clear!Object

Clear all items.



24
25
26
# File 'lib/brute/store/todo_store.rb', line 24

def clear!
  @mutex.synchronize { @items.clear }
end

.replace(items) ⇒ Object

Replace the entire todo list.



14
15
16
# File 'lib/brute/store/todo_store.rb', line 14

def replace(items)
  @mutex.synchronize { @items = items.dup }
end