SingleForwardable (Module)

In: forwardable.rb

Public Instance methods

def_delegator(accessor, method, ali = method)
def_delegators(accessor, *methods)

[Source]

# File forwardable.rb, line 72
  def def_singleton_delegator(accessor, method, ali = method)
    accessor = accessor.id2name if accessor.kind_of?(Integer)
    method = method.id2name if method.kind_of?(Integer)
    ali = ali.id2name if ali.kind_of?(Integer)

    instance_eval("def \#{ali}(*args, &block)\nbegin\n\#{accessor}.__send__(:\#{method}, *args,&block)\nrescue Exception\n$@.delete_if{|s| /^\\\\(__FORWARDABLE__\\\\):/ =~ s} unless Forwardable::debug\nKernel::raise\nend\nend\n", "(__FORWARDABLE__)", 1)
  end

[Source]

# File forwardable.rb, line 66
  def def_singleton_delegators(accessor, *methods)
    for method in methods
      def_singleton_delegator(accessor, method)
    end
  end

[Validate]