Sha256: b30d0af6e8bb4508bdfc41df234c87fcaaee97f63fa914f524c3e138474af407
Contents?: true
Size: 629 Bytes
Versions: 14
Compression:
Stored size: 629 Bytes
Contents
require 'absolute_renamer/use_config' module AbsoluteRenamer # Class allowing childs listing. class WithChildren include AbsoluteRenamer::UseConfig @children = [] class << self attr_reader :children # Inheritance callback. # When a class inherit from a WithChildren class, it is added to # the childs list of this class. # This list is available as the +children+ attribute. def inherited(by) @children << by by.instance_variable_set(:@children, []) end end end end
Version data entries
14 entries across 14 versions & 2 rubygems