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
- #trigger_transactional_callbacks? ⇒ Boolean
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
52 53 54 |
# File 'lib/after_transaction.rb', line 52 def add_to_transaction AfterTransaction.call &@callable end |
#before_committed!(*_) ⇒ Object
44 |
# File 'lib/after_transaction.rb', line 44 def before_committed!(*_); end |
#committed!(*_) ⇒ Object
46 47 48 |
# File 'lib/after_transaction.rb', line 46 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
50 |
# File 'lib/after_transaction.rb', line 50 def rolledback!(*_); end |
#trigger_transactional_callbacks? ⇒ Boolean
40 41 42 |
# File 'lib/after_transaction.rb', line 40 def trigger_transactional_callbacks? true end |