Class: PikoTransaction::DeleteCommand
- Defined in:
- lib/piko_transaction/delete_command.rb
Instance Method Summary collapse
- #do ⇒ Object
-
#initialize(document_id, collection, &success_action) ⇒ DeleteCommand
constructor
A new instance of DeleteCommand.
- #undo ⇒ Object
Methods inherited from Command
#add_failure_callback, #add_success_callback, #name, #to_s
Methods included from Logger
Constructor Details
#initialize(document_id, collection, &success_action) ⇒ DeleteCommand
Returns a new instance of DeleteCommand.
24 25 26 27 28 29 30 |
# File 'lib/piko_transaction/delete_command.rb', line 24 def initialize(document_id, collection, &success_action) super() @document_id = document_id @collection = collection @success_action = success_action @deleted_doc = nil end |
Instance Method Details
#do ⇒ Object
32 33 34 35 |
# File 'lib/piko_transaction/delete_command.rb', line 32 def do add_success_callback @success_action remove_document ? call_success_callbacks : call_failure_callbacks end |
#undo ⇒ Object
37 38 39 |
# File 'lib/piko_transaction/delete_command.rb', line 37 def undo store_document end |