class Cattri::AttributeRegistry

def defined_attributes(with_ancestors: false)

Returns:
  • (Hash{Symbol => Cattri::Attribute}) -

Parameters:
  • with_ancestors (Boolean) -- whether to include ancestors
def defined_attributes(with_ancestors: false)
  return registered_attributes unless with_ancestors
  context.attribute_lookup_sources
         .select { |mod| mod.respond_to?(:attribute_registry, true) }
         .flat_map { |mod| mod.send(:attribute_registry).registered_attributes.to_a }
         .to_h
         .merge(registered_attributes)
         .freeze
end