Class: RailsTransactionalOutbox::ReliableModel::ReliableCallback
- Inherits:
-
Object
- Object
- RailsTransactionalOutbox::ReliableModel::ReliableCallback
- Defined in:
- lib/rails_transactional_outbox/reliable_model/reliable_callback.rb
Instance Method Summary collapse
- #call(model) ⇒ Object
- #for_event?(event_type) ⇒ Boolean
-
#initialize(callback, options) ⇒ ReliableCallback
constructor
A new instance of ReliableCallback.
Constructor Details
#initialize(callback, options) ⇒ ReliableCallback
Returns a new instance of ReliableCallback.
9 10 11 12 |
# File 'lib/rails_transactional_outbox/reliable_model/reliable_callback.rb', line 9 def initialize(callback, ) @callback = callback @options = end |
Instance Method Details
#call(model) ⇒ Object
18 19 20 21 22 |
# File 'lib/rails_transactional_outbox/reliable_model/reliable_callback.rb', line 18 def call(model) return unless execute?(model) model.instance_exec(&callback) end |
#for_event?(event_type) ⇒ Boolean
14 15 16 |
# File 'lib/rails_transactional_outbox/reliable_model/reliable_callback.rb', line 14 def for_event?(event_type) on.include?(event_type.to_sym) end |