class Object

Public Instance Methods

_?(*args)
Alias for: cig
cig(*args) { |self| ... } click to toggle source
# File lib/cig.rb, line 2
def cig(*args)
  args = args.dup

  if block_given?
    raise ArgumentError, 'Do not pass this method both a block and other arguments.' if args.any?
    return yield self
  end

  obj, meth = args.first.is_a?(Symbol) ? [self, args.shift] : [args.shift, args.shift]

  send_meth = obj == self ? :send : :public_send
  obj.send send_meth, meth, self, *args
end
Also aliased as: _?