Module: Skywalker::Transactional
- Included in:
- Command
- Defined in:
- lib/skywalker/transactional.rb
Class Method Summary collapse
-
.included(klass) ⇒ Object
Requires Acceptable and add accessors for callbacks.
Instance Method Summary collapse
-
#call ⇒ Object
Runs the transaction and all operations.
Class Method Details
.included(klass) ⇒ Object
Requires Acceptable and add accessors for callbacks.
11 12 13 14 |
# File 'lib/skywalker/transactional.rb', line 11 def self.included(klass) klass.include Acceptable klass.send(:attr_accessor, :on_success, :on_failure, :error) end |
Instance Method Details
#call ⇒ Object
Runs the transaction and all operations.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/skywalker/transactional.rb', line 22 def call transaction do execute! confirm_success end rescue Exception => error confirm_failure error end |