Class: Interceptors::TransactionInterceptor
- Inherits:
-
Interceptor
- Object
- Interceptor
- Interceptors::TransactionInterceptor
- Defined in:
- lib/interceptors/transaction_interceptor.rb
Instance Method Summary collapse
- #around(ctx) ⇒ Object
-
#initialize(adapter: default_adapter) ⇒ TransactionInterceptor
constructor
A new instance of TransactionInterceptor.
Methods inherited from Interceptor
Constructor Details
#initialize(adapter: default_adapter) ⇒ TransactionInterceptor
Returns a new instance of TransactionInterceptor.
5 6 7 |
# File 'lib/interceptors/transaction_interceptor.rb', line 5 def initialize(adapter: default_adapter) @adapter = adapter end |
Instance Method Details
#around(ctx) ⇒ Object
9 10 11 12 13 |
# File 'lib/interceptors/transaction_interceptor.rb', line 9 def around(ctx) return yield ctx unless @adapter @adapter.call { yield ctx } end |