Method: Multimethod::Table#find_method

Defined in:
lib/multimethod/table.rb

#find_method(x) ⇒ Object

Returns a list of all the Methods that match a signature.

The signature can be a String, Method or Signature object.



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/multimethod/table.rb', line 104

def find_method(x)
  case x
  when String
    signature = Signature.new(:string => x)
  when Method
    signature = x.signature
  when Signature
    signature = x
  end

  x = @multimethod.select{|mm| mm.matches_signature(signature)}
  # $stderr.puts "find_method(#{x}) => #{x.inspect}"
  x = x.collect{|mm| mm.find_method(signature)}.flatten

  # $stderr.puts "find_method(#{x}) => #{x.inspect}"
  x
end