Sha256: 0cff1af79052c1d928f529a3ac2943281b68ab4e93329d55adb7f8a4f0341f39
Contents?: true
Size: 644 Bytes
Versions: 1
Compression:
Stored size: 644 Bytes
Contents
module Virtus # A module that adds descendant tracking to a class module DescendantsTracker # Hook called when class is inherited # # @param [Class] descendant # # @return [self] # # @api private def inherited(descendant) superclass = self.superclass superclass.inherited(descendant) if superclass.respond_to?(:descendants) descendants.unshift(descendant) self end # Return the descendants of this class # # @return [Array<Class>] # # @api private def descendants @descendants ||= [] end end # module DescendantsTracker end # module Virtus
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
virtus-0.0.4 | lib/virtus/support/descendants_tracker.rb |