Since #respond_to? only checks whether an object responds to a call,
not what it does in response; since #can? as an alias to #respond_to?
would be misleading in that it wouldn't really check what the object
does; since typing a la C or Java takes much away from the language
and is no better indicator of the real behaviour of an object; what
about this?


class Foo
  def meth(bar)
    bar.passes?(TestBar) or raise ArgumentError
  end
end
Foo.new.meth(1)

$ ruby --inline-tests foo.rb


Just a thought.


Massimiliano