Skip to content

v1.0.0

Compare
Choose a tag to compare
@flash-gordon flash-gordon released this 07 Oct 09:34
v1.0.0
d8af8b9

1.0.0 2019-04-23

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)

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)
    User = Dry::Struct(name: 'string')
    User.(1) { :oh_no }
    # => :oh_no

Compare v0.7.0...v1.0.0