dry-struct v1.0.0 Release Notes

Release Date: 2019-04-23 // over 2 years ago
  • ➕ Added

    • Struct.call now accepts an optional block that will be called on failed coercion. This behavior is consistent with dry-types 1.0. Note that .new doesn't take a block (flash-gordon) ruby User = Dry::Struct(name: 'string') User.(1) { :oh_no } # => :oh_no

    🔄 Changed

    • valid? and === behave differently, === works the same way Class#=== does and valid? checks if the value can be coerced to the struct (flash-gordon)

    Compare v0.7.0...v1.0.0