Class: CallSheet::StepAdapters::Try Private
- Defined in:
- lib/call_sheet/step_adapters/try.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #call(*args, input) ⇒ Object private
-
#initialize ⇒ Try
constructor
private
A new instance of Try.
Methods inherited from Base
Constructor Details
#initialize ⇒ Try
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Try.
5 6 7 8 |
# File 'lib/call_sheet/step_adapters/try.rb', line 5 def initialize(*) super raise ArgumentError, "+try+ steps require one or more exception classes provided via +catch:+" unless [:catch] end |
Instance Method Details
#call(*args, input) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 13 14 |
# File 'lib/call_sheet/step_adapters/try.rb', line 10 def call(*args, input) Success(operation.call(*args, input)) rescue *Array([:catch]) => e Failure(e) end |