Class: AfterTransaction::Wrapper
- Inherits:
-
Object
- Object
- AfterTransaction::Wrapper
- Defined in:
- lib/after_transaction.rb
Instance Method Summary collapse
- #add_to_transaction ⇒ Object
- #before_committed!(*_) ⇒ Object
- #committed!(*_) ⇒ Object
- #has_transactional_callbacks? ⇒ Boolean
-
#initialize(callable) ⇒ Wrapper
constructor
A new instance of Wrapper.
- #rolledback!(*_) ⇒ Object
Constructor Details
#initialize(callable) ⇒ Wrapper
Returns a new instance of Wrapper.
32 33 34 |
# File 'lib/after_transaction.rb', line 32 def initialize(callable) @callable = callable end |
Instance Method Details
#add_to_transaction ⇒ Object
48 49 50 |
# File 'lib/after_transaction.rb', line 48 def add_to_transaction AfterTransaction.call &@callable end |
#before_committed!(*_) ⇒ Object
40 |
# File 'lib/after_transaction.rb', line 40 def before_committed!(*_); end |
#committed!(*_) ⇒ Object
42 43 44 |
# File 'lib/after_transaction.rb', line 42 def committed!(*_) @callable.call end |
#has_transactional_callbacks? ⇒ Boolean
36 37 38 |
# File 'lib/after_transaction.rb', line 36 def has_transactional_callbacks? true end |
#rolledback!(*_) ⇒ Object
46 |
# File 'lib/after_transaction.rb', line 46 def rolledback!(*_); end |