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

METHODS, VERSION

Instance Attribute Summary

Attributes included from Mixin

#to_proc

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ToProcInterface

loader

Methods included from Mixin

#call

Class Method Details

.callObject



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_unsafeObject



24
25
26
# File 'lib/to_proc_interface/wrapping_call.rb', line 24

def call_unsafe(...)
  new(...).call_unsafe
end