Class: Skywalker::Command
- Inherits:
-
Object
- Object
- Skywalker::Command
- Includes:
- Acceptable
- Defined in:
- lib/skywalker/command.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#on_failure ⇒ Object
Returns the value of attribute on_failure.
-
#on_success ⇒ Object
Returns the value of attribute on_success.
Class Method Summary collapse
-
.call(*args) ⇒ Object
Provides a convenient way to call a command without having to instantiate and call.
Instance Method Summary collapse
-
#call ⇒ Object
Call: runs the transaction and all operations.
Methods included from Acceptable
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
23 24 25 |
# File 'lib/skywalker/command.rb', line 23 def error @error end |
#on_failure ⇒ Object
Returns the value of attribute on_failure.
23 24 25 |
# File 'lib/skywalker/command.rb', line 23 def on_failure @on_failure end |
#on_success ⇒ Object
Returns the value of attribute on_success.
23 24 25 |
# File 'lib/skywalker/command.rb', line 23 def on_success @on_success end |
Class Method Details
.call(*args) ⇒ Object
Provides a convenient way to call a command without having to instantiate and call.
18 19 20 |
# File 'lib/skywalker/command.rb', line 18 def self.call(*args) new(*args).call end |
Instance Method Details
#call ⇒ Object
Call: runs the transaction and all operations.
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/skywalker/command.rb', line 33 def call transaction do execute! confirm_success end rescue Exception => error confirm_failure error end |