dry-types v1.0.1 Release Notes
Release Date: 2019-06-04 // almost 5 years ago-
➕ Added
- In a case of failure the constructor block can now pass a different value (flash-gordon)
ruby not_empty_string = Types::String.constructor do |value, &failure| value.strip.empty? ? failure.(nil) : value.strip end not_empty_string.(' ') { |v| v } # => nil not_empty_string.lax.(' ') # => nil not_empty_string.lax.(' foo ') # => "foo"
Schema#strict
now accepts an boolean argument. Iffales
is passed this will turn a strict schema into a non-strict one (flash-gordon)
- In a case of failure the constructor block can now pass a different value (flash-gordon)