Value objects (#293)
This PR introduces `Literal::Value` objects. Literal::Values are
designed to wrap primitives (though they can wrap any object) in a
branded object allowing for more precise type-matching.
```ruby
UserID = Literal::Value(Integer)
my_user_id = UserID.new(123)
```
### Constraints
You can pass constraints, same as `_Constraint`
```ruby
Username = Literal::Value(String, length: 3..15)
```
### Coercion
Literal value classes can be coerced into a coercion by default
```ruby
prop :user, UserID, &UserID
```
### Delegation
You can delegate to underlying methods
```ruby
Username = Literal::Value(String) do
delegate :length
end
```
Literal will default to delegating to basic coercion methods. For
example, if your value is a String, it will delegate `to_s` and `to_str`
to the underlying value by default. Otherwise, delegation is explicit.
Only delegate what you need. Constraining the interface allows for more
flexibility later on. If you want to replace a value object with a
regular object, you won’t need to re-implement the entire interface of a
primitive.
### Customisation
```ruby
Name = Literal::Value(String) do
def first
@value.split(" ").first
end
end
```
### Freezing
Literal value classes and literal value objects are frozen by default,
though their underlying values are not automatically frozen.
authored by