Method: SmartEnum::Attributes::ClassMethods#inherited

Defined in:
lib/smart_enum/attributes.rb

#inherited(child_class) ⇒ Object



40
41
42
43
44
45
46
47
# File 'lib/smart_enum/attributes.rb', line 40

def inherited(child_class)
  # STI children should start with an attribute set cloned from their parent.
  # Otherwise theirs will start blank.
  child_class.instance_variable_set(:@attribute_set, self.attribute_set.dup)
  # STI children must *share* a reference to the same init_mutex as their
  # parent so that reads are correctly blocked during async loading.
  child_class.instance_variable_set(:@_init_mutex, @_init_mutex)
end