<imodev / softhome.net> wrote...
> ... what about overloading based on parameter's
> classes? Something like (in C++):
>
> int test(int a)
> int test(char* a)
>
> Is there any way or must I write some code like: if (a.class == 'class')
> then...?

Yes. The class method returns a Class object. So you can compare:
    a.class <= Integer
to check if a is an Integer or any subclass of Integer.

Better, you can use the kind_of? method:
    a.kind_of?(Integer)
which is more obvious.

But for this situation, a case statement is probably best:

def test(a)
  case a
    when Integer
      # ...
    when String
      # ...
    else
      raise ArgumentError, "test(a): parameter must be Integer or String",
caller
  end
end