Ruby does not have such thing, but all you have to do is add a single line as so:
def do_something(x)
raise "Argument error blah blah" unless x.kind_of?(MyClass)
...
end
Not a big deal. But if you feel it is too verbose, then just define a method:
module Kernel
def verify klass, arg
raise "Argument error blah blah" unless arg.kind_of?(klass)
end
end
and put that in the first line:
def do_something(x)
verify(MyClass, x)
...
end