Module: OmnifocusMcp::Tools::Messages::RemoveItem
- Defined in:
- lib/omnifocus_mcp/tools/messages/remove_item.rb
Class Method Summary collapse
- .failure(args, error) ⇒ Object
- .invalid_item_type(item_type) ⇒ Object
- .missing_identifier ⇒ Object
- .success(args, removed) ⇒ Object
Class Method Details
.failure(args, error) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/omnifocus_mcp/tools/messages/remove_item.rb', line 19 def failure(args, error) base = "Failed to remove #{args[:itemType]}" return base unless error if error.include?("Item not found") (args) else "#{base}: #{error}" end end |
.invalid_item_type(item_type) ⇒ Object
10 11 12 |
# File 'lib/omnifocus_mcp/tools/messages/remove_item.rb', line 10 def invalid_item_type(item_type) "Invalid item type: #{item_type}. Must be either 'task' or 'project'." end |
.missing_identifier ⇒ Object
8 |
# File 'lib/omnifocus_mcp/tools/messages/remove_item.rb', line 8 def missing_identifier = "Either id or name must be provided to remove an item." |
.success(args, removed) ⇒ Object
14 15 16 17 |
# File 'lib/omnifocus_mcp/tools/messages/remove_item.rb', line 14 def success(args, removed) label = args[:itemType] == "task" ? "Task" : "Project" %(✅ #{label} "#{removed.name}" removed successfully.) end |