Over a million developers have joined DZone.

Example Of Detecting Subclasses

·
class A
  def A.inherited(clazz)
    puts "Hey, #{clazz} is subclassing me"
  end
end
 
class B < A; end
 
 
Produces:
 
$ ruby x.rb
Hey, B is subclassing me
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}