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
-
.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.
18 19 20 |
# File 'lib/brute/store/todo_store.rb', line 18 def all @mutex.synchronize { @items.dup } end |
.clear! ⇒ Object
Clear all items.
23 24 25 |
# File 'lib/brute/store/todo_store.rb', line 23 def clear! @mutex.synchronize { @items.clear } end |
.replace(items) ⇒ Object
Replace the entire todo list.
13 14 15 |
# File 'lib/brute/store/todo_store.rb', line 13 def replace(items) @mutex.synchronize { @items = items.dup } end |