is_a? checks whether an object belongs to a specified class or to one of that class’s ancestral classes. It follows Ruby’s inheritance hierarchy from specific classes toward general ones. section 3.8
>> mag = Magazine.new
=> #<Magazine:0x000000012d972100>
>> mag.is_a?(Magazine)
=> true
>> mag.is_a?(Publication)
=> true
A Magazine instance reports true for both Magazine and its ancestor class Publication. section 3.8
Checking an inheritance relationship
If Magazine inherits from Publication, mag.is_a?(Magazine) and mag.is_a?(Publication) both return true. The test describes class ancestry, not every capability the object may acquire individually. section 3.8
