module Cattri::InitializerPatch

def initialize(*args, **kwargs, &block)

Returns:
  • (void) -

Other tags:
    Yield: - an optional block to pass to `super`

Parameters:
  • kwargs (Hash) -- any keyword arguments passed to initialize
  • args (Array) -- any positional arguments passed to initialize
def initialize(*args, **kwargs, &block)
  super
  registry = self.class.send(:attribute_registry)
  registry.defined_attributes(with_ancestors: true).each_value do |attribute| # steep:ignore
    next if cattri_variable_defined?(attribute.ivar) # steep:ignore
    next unless attribute.final?
    cattri_variable_set(attribute.ivar, attribute.evaluate_default) # steep:ignore
  end
end