class Cattri::AttributeRegistry
def fetch_attribute!(name, with_ancestors: false)
-
(Cattri::AttributeError)
- if the attribute is not defined
Returns:
-
(Cattri::Attribute)
-
Parameters:
-
with_ancestors
(Boolean
) -- -
name
(String, Symbol
) --
def fetch_attribute!(name, with_ancestors: false) defined_attributes(with_ancestors: with_ancestors).fetch(name.to_sym) do raise Cattri::AttributeError, "Attribute :#{name} has not been defined" end end