Class: Reacto::Operations::RescueAndReplaceError
- Inherits:
-
Object
- Object
- Reacto::Operations::RescueAndReplaceError
- Defined in:
- lib/reacto/operations/rescue_and_replace_error.rb
Instance Method Summary collapse
- #call(tracker) ⇒ Object
-
#initialize(action) ⇒ RescueAndReplaceError
constructor
A new instance of RescueAndReplaceError.
Constructor Details
#initialize(action) ⇒ RescueAndReplaceError
Returns a new instance of RescueAndReplaceError.
6 7 8 |
# File 'lib/reacto/operations/rescue_and_replace_error.rb', line 6 def initialize(action) @action = action end |
Instance Method Details
#call(tracker) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/reacto/operations/rescue_and_replace_error.rb', line 10 def call(tracker) error = -> (e) do trackable = @action.call(e) trackable.send(:do_track, tracker) end Subscriptions::OperationSubscription.new(tracker, error: error) end |