class Cattri::AttributeRegistry

def copy_attributes_to(target_context)

Returns:
  • (void) -

Parameters:
  • target_context (Cattri::Context) --
def copy_attributes_to(target_context)
  registered_attributes.each_value do |attribute|
    next unless attribute.class_attribute? && attribute.final?
    target_registry = target_context.target.send(:attribute_registry)
    target_registry.send(:register_attribute, attribute)
    value = context.target.cattri_variable_get(attribute.ivar) # steep:ignore
    target_context.target.cattri_variable_set(attribute.ivar, value) # steep:ignore
  end
end