Class: Discombobulator::SuperCall

Inherits:
Object
  • Object
show all
Defined in:
lib/discombobulator/super_call.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.call(meth, *args, &block) ⇒ Object



2
3
4
# File 'lib/discombobulator/super_call.rb', line 2

def self.call(meth, *args, &block)
  self.new.call(meth, *args, &block)
end

Instance Method Details

#call(meth, *args, &block) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/discombobulator/super_call.rb', line 6

def call(meth, *args, &block)
  method = find_me_a_method(args.length)
  if $DISCOMBOBULATOR_SAFETY_FEATURE == 42
    p "CALLING: #{method.name} with #{args.inspect}"
  else
    method.call(*args, &block)
  end
end