module Switchman::CallSuper

Public Instance Methods

call_super(method, above_module, *args, &block) click to toggle source
# File lib/switchman/call_super.rb, line 15
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) click to toggle source
# File lib/switchman/call_super.rb, line 5
def super_method_above(method_name, above_module)
  method = method(method_name)
  last_owner = method.owner
  while method.owner != above_module
    method = method.super_method
    raise "Could not find super method ``#{method_name}' for #{self.class}" if method.owner == last_owner
  end
  method.super_method
end