@coop How’s this read?
(Technically, these examples are entities rather than strict value types, because we include the record IDs in their attributes, which you'd expect to be the key indicator of equality. However, in practice,
Dry::Types::Struct
instances still check for equality across all attributes, and in our apps we only ever instantiate these objects from known-good database data, which means they still behave effectively as value objects. So let's continue!)
validates :title, :presence
type syntax ?
(error messages, output hash) => activemodel
and (full type) => activemodel