class Sequent::Core::ValueObject

ValueObject is a container for data that belongs together but requires no identity

If something requires identity is up to you to decide. An example in for instance the invoicing domain could be a person’s Address.

class Address < Sequent::Core::ValueObject
  attrs street: String, city: String, country: Country
end

A ValueObject is equal to another ValueObject if and only if all attrs are equal.

You can copy a valueobject as follows:

new_address = address.copy(street: "New Street")

This a deep clone of the address with the street attribute containing “New Street”