Module: Switchman::CallSuper

Defined in:
lib/switchman/call_super.rb

Instance Method Summary collapse

Instance Method Details

#call_super(method, above_module, *args, &block) ⇒ Object



11
12
13
# File 'lib/switchman/call_super.rb', line 11

def call_super(method, above_module, *args, &block)
  super_method_above(method, above_module).call(*args, &block)
end

#super_method_above(method_name, above_module) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/switchman/call_super.rb', line 3

def super_method_above(method_name, above_module)
  method = method(method_name)
  while method.owner != above_module
    method = method.super_method
  end
  method.super_method
end