kernel/common/module.rb
##
# Returns an UnboundMethod corresponding to the given name. The name will be
# searched for in this Module as well as any included Modules or
# superclasses. The UnboundMethod is populated with the method name and the
# Module that the method was located in.
#
# Raises a TypeError if the given name.to_sym fails and a NameError if the
# name cannot be located.
Returns an UnboundMethod corresponding to the given name. The name will be
searched for in this Module as well as any included Modules or
superclasses. The UnboundMethod is populated with the method name and the
Module that the method was located in.

Raises a TypeError if the given name.to_sym fails and a NameError if the
name cannot be located.
Returns an UnboundMethod corresponding to the given name . The name will be searched for in this Module as well as any included Modules or superclasses . The UnboundMethod is populated with the method name and the Module that the method was located in . Raises a TypeError if the given name . to_sym fails and a NameError if the name cannot be located .
def instance_method(name)
    name = Type.coerce_to name, Symbol, :to_sym
    mod = self
    cmethod = @method_table[name]
    while mod and cmethod.nil? do
      mod = mod.direct_superclass
      cmethod = mod.method_table[name] if mod
    end
    cmethod = cmethod.method if cmethod.kind_of? CompiledMethod::Visibility
    mod = mod.module if mod.class == IncludedModule
    return UnboundMethod.new(mod, cmethod, self) if cmethod
    raise NameError, "Undefined method `#{name}' for #{self}"
  end
def instance_method ( name ) name = Type . coerce_to name , Symbol , :to_sym mod = self cmethod = @method_table [ name ] while mod and cmethod . nil? do mod = mod . direct_superclass cmethod = mod . method_table [ name ] if mod end cmethod = cmethod . method if cmethod . kind_of? CompiledMethod :: Visibility mod = mod . module if mod . class == IncludedModule return UnboundMethod . new ( mod , cmethod , self ) if cmethod raise NameError , "Undefined method `#{name}' for #{self}" end
Returns an UnboundMethod corresponding to the given name.
Returns an UnboundMethod corresponding to the given name .
# unwrap the real method from Visibility if needed # We want to show the real module
name
<not_specific>