Next-gen ruby libs! » github.com/dry-rb » website: https://dry-rb.org » forum: https://discourse.dry-rb.org
cater for the fact we may have unexpected keys
?
{ foo: ‘bar’, email: ‘jane@doe’ }
while not having foo
specified it should be a validation error
{}
is not the same as { email: nil }
even though {}[:email]
happily returns nil
key(:address).hash? do |address|
address.key(:age).int? { |value| value.gt?(18) }
end
key(:address).hash? do |address|
address.key(:age).int? & address.key(:age).gt?(18)
end
value.int? & value.gt?(18)
and the equivalent of this is using a block like this; value.int? { value.gt?(18) }
AND
AND
where the right only evaluates if the left passes?