It is almost the same. Can you use the Object instance_of? method instance_of? :
"a".instance_of? String # => true "a".instance_of? Object # => false
is_a? Ruby also have is_a? methods is_a? and kind_of? (these 2 are aliases and work the same way), which returns true , is one of the superclasses:
"a".is_a? String # => true "a".is_a? Object # => true
John Topley Aug 6 '10 at 14:38 2010-08-06 14:38
source share