Genesis.Value (genesis v0.7.0)
View SourceSummary
Functions
Casts attrs against the given props definition.
Checks that the given value can be used as a prop of type.
Raises ArgumentError if the value does not match the type.
Defines a property for an Aspect.
Functions
Casts attrs against the given props definition.
Checks that the given value can be used as a prop of type.
Raises ArgumentError if the value does not match the type.
Defines a property for an Aspect.
Examples
prop :name, :binary, required: true
prop :age, :integer, default: 0The supported types are: :atom, :binary, :boolean, :datetime,
:float, :integer, :pid, :ref.
Options
:required- when set totrue, the property must be provided when creating or updating the aspect. Defaults tofalse.:default- specifies a default value for the property if none is provided.
Validation
The property value is validated against its type when the aspect is created
or updated. If the value does not match the type, an ArgumentError is raised.