Module: Brute::TodoStore
- Defined in:
- lib/brute/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
-
.all ⇒ Object
Return all current items.
-
.clear! ⇒ Object
Clear all items.
-
.replace(items) ⇒ Object
Replace the entire todo list.
Class Method Details
.all ⇒ Object
Return all current items.
17 18 19 |
# File 'lib/brute/todo_store.rb', line 17 def all @mutex.synchronize { @items.dup } end |
.clear! ⇒ Object
Clear all items.
22 23 24 |
# File 'lib/brute/todo_store.rb', line 22 def clear! @mutex.synchronize { @items.clear } end |
.replace(items) ⇒ Object
Replace the entire todo list.
12 13 14 |
# File 'lib/brute/todo_store.rb', line 12 def replace(items) @mutex.synchronize { @items = items.dup } end |