Module: ToProcInterface::WrappingCall
- Includes:
- ToProcInterface
- Defined in:
- lib/to_proc_interface/wrapping_call.rb
Overview
Note:
Block passed to class-level WrappingCall.call will be yield to instance-level #call
Constant Summary
Constants included from ToProcInterface
Instance Attribute Summary
Attributes included from Mixin
Class Method Summary collapse
Instance Method Summary collapse
Methods included from ToProcInterface
Methods included from Mixin
Class Method Details
.call ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/to_proc_interface/wrapping_call.rb', line 12 def call(...) if block_given? call_safe(...) else call_unsafe(...) end end |
Instance Method Details
#call_safe(*args, **opts, &block) ⇒ Object
20 21 22 |
# File 'lib/to_proc_interface/wrapping_call.rb', line 20 def call_safe(*args, **opts, &block) new(*args, **opts).call_safe(&block) end |
#call_unsafe ⇒ Object
24 25 26 |
# File 'lib/to_proc_interface/wrapping_call.rb', line 24 def call_unsafe(...) new(...).call_unsafe end |