Class: NucleusCore::Operation
- Inherits:
-
Object
- Object
- NucleusCore::Operation
- Defined in:
- lib/nucleus_core/operation.rb
Defined Under Namespace
Classes: Context
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(args = {}) ⇒ Operation
constructor
A new instance of Operation.
- #rollback ⇒ Object
Constructor Details
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
38 39 40 |
# File 'lib/nucleus_core/operation.rb', line 38 def context @context end |
Class Method Details
.call(args = {}) ⇒ Object
44 45 46 47 48 49 50 51 52 |
# File 'lib/nucleus_core/operation.rb', line 44 def self.call(args={}) operation = new(args) operation.call operation.context rescue Context::Error operation.context end |
.rollback(context) ⇒ Object
54 55 56 57 58 59 60 |
# File 'lib/nucleus_core/operation.rb', line 54 def self.rollback(context) operation = new(context) operation.rollback operation.context end |
Instance Method Details
#call ⇒ Object
62 63 |
# File 'lib/nucleus_core/operation.rb', line 62 def call end |
#rollback ⇒ Object
65 66 |
# File 'lib/nucleus_core/operation.rb', line 65 def rollback end |