"Tobias Reif" <tobiasreif / pinkjuice.com> wrote in
....
> how can I programmatically find out which objects a certain method can
> take if any?

If only ask for the arity assuming that  klass is a Class object and meth
a symbol or string.

def k_arity(klass,meth)
    klass.class_eval { instance_method (meth).arity }
end

for singleton methods this would be

def s_arity(obj,meth)
    class << obj;  instance_method (meth).arity end
end

Qualified class names have to preprocessed with something like

class String
  def to_constant(scope = ::Object)
    if md = (/(::)/).match(self)
      (md.post_match).to_constant(scope.const_get(md.pre_match))
    else
      scope.const_get(self)
    end
  end
end


/Christoph