lib/forwardablex.rb
# Forward the name to the Proc result.
#
# @param proc [Proc]
#   Proc object that generate the receiver
# @param method [Symbol]
#   method name of the proc result
# @param name [Symbol]
#   forwarder method name
# @param _args [Array<Object>]
#   additional arguments
# @return [void]
Forward the name to the Proc result.
Forward the name to the Proc result .
def forward_proc_receiver(proc, method, name, *_args)
    define_method(name) do |*args, &b|
      instance_eval(&proc).__send__(method, *_args, *args, &b)
    end
  end
def forward_proc_receiver ( proc , method , name , * _args ) define_method ( name ) do | * args , & b | instance_eval ( & proc ) . __send__ ( method , * _args , * args , & b ) end end
Forward the name to the Proc result.
Forward the name to the Proc result .
None
void
proc
Proc object that generate the receiver
Proc object that generate the receiver
method
method name of the proc result
method name of the proc result
name
forwarder method name
forwarder method name
_args
None