Module: Domainic::Attributer Abstract
- Defined in:
- lib/domainic/attributer.rb,
lib/domainic/attributer/attribute.rb,
lib/domainic/attributer/undefined.rb,
lib/domainic/attributer/errors/error.rb,
lib/domainic/attributer/attribute_set.rb,
lib/domainic/attributer/class_methods.rb,
lib/domainic/attributer/dsl/initializer.rb,
lib/domainic/attributer/instance_methods.rb,
lib/domainic/attributer/attribute/coercer.rb,
lib/domainic/attributer/attribute/callback.rb,
lib/domainic/attributer/attribute/signature.rb,
lib/domainic/attributer/attribute/validator.rb,
lib/domainic/attributer/dsl/method_injector.rb,
lib/domainic/attributer/dsl/attribute_builder.rb,
lib/domainic/attributer/errors/aggregate_error.rb,
lib/domainic/attributer/errors/callback_execution_error.rb,
lib/domainic/attributer/errors/coercion_execution_error.rb,
lib/domainic/attributer/errors/validation_execution_error.rb,
lib/domainic/attributer/dsl/attribute_builder/option_parser.rb,
lib/domainic/attributer/attribute/mixin/belongs_to_attribute.rb
Overview
Can be included directly with default method names or customized via Attributer
Domainic::Attributer
is a powerful toolkit that brings clarity and safety to your Ruby class attributes.
Ever wished your class attributes could:
- Validate themselves to ensure they only accept correct values?
- Transform input data automatically into the right format?
- Have clear, enforced visibility rules?
- Handle their own default values intelligently?
- Tell you when they change?
- Distinguish between required arguments and optional settings?
That's exactly what Domainic::Attributer
does! It provides a declarative way to define and manage attributes
in your Ruby classes, ensuring data integrity and clear interfaces. It's particularly valuable for:
- Domain models and value objects
- Service objects and command patterns
- Configuration objects
- Any class where attribute behavior matters
Think of it as giving your attributes a brain - they know what they want, how they should behave, and they're not afraid to speak up when something's not right!
Defined Under Namespace
Modules: ClassMethods, DSL, InstanceMethods Classes: CallbackExecutionError, CoercionExecutionError, ValidationExecutionError