Module: Comandor::ClassMethods
- Defined in:
- lib/comandor.rb
Overview
ClassName.perform
Instance Method Summary collapse
-
#inherited(child) ⇒ Object
Callback when inherited from Comandor class.
- #perform(*args, &block) ⇒ Object
-
#transaction!(name) ⇒ Object
Add transaction layer.
-
#transaction_klass ⇒ Object
Class variables accessor.
- #transaction_method ⇒ Object
Instance Method Details
#inherited(child) ⇒ Object
Callback when inherited from Comandor class
18 19 20 21 |
# File 'lib/comandor.rb', line 18 def inherited(child) child.prepend(Comandor) child.extend(ClassMethods) end |
#perform(*args, &block) ⇒ Object
23 24 25 |
# File 'lib/comandor.rb', line 23 def perform(*args, &block) new.perform(*args, &block) end |
#transaction!(name) ⇒ Object
Add transaction layer
29 30 31 |
# File 'lib/comandor.rb', line 29 def transaction!(name) class_eval { @transaction_klass, @transaction_method = name.split('.') } end |
#transaction_klass ⇒ Object
Class variables accessor
34 35 36 |
# File 'lib/comandor.rb', line 34 def transaction_klass @transaction_klass end |
#transaction_method ⇒ Object
38 39 40 |
# File 'lib/comandor.rb', line 38 def transaction_method @transaction_method end |