Determining type of an object in ruby
The proper way to determine the “type” of an object, which is a wobbly term in the Ruby world, is to call object.class. Since classes can inherit from other classes, if you want to determine if an object is “of a particular type” you might call object.is_a?(ClassName) to see if object is of type ClassName or derived from it. Normally type checking … Read more