Module: Micro::Attributes::Composition

Defined in:
lib/micro/attributes/composition.rb

Overview

Composition behavior baked into every ‘Micro::Attributes` includer.

  • ‘Coercion` (prepended): hashes assigned to an attribute whose `accept:` is another `Micro::Attributes` class are auto-built into instances of that class. Errors on the constructed child bubble up as `’is invalid’‘ markers in the parent’s ‘attributes_errors` (when `Accept` is active).

  • ‘Instance#validate_nested_entities` (included): walks nested `Micro::Attributes` children and surfaces their invalidity into ActiveModel `errors`. Auto-registered by `Features::ActiveModelValidations.included`.

Defined Under Namespace

Modules: Coercion, Instance