dry-struct v1.1.1 Release Notes

Release Date: 2019-10-13 // about 2 months ago
  • 🔄 Changed

    • Pattern matching syntax is simplified with deconstruct_keys (k-tsj)
      User = Dry.Struct(name: 'string', email: 'string')
    
      user = User.new(name: 'John Doe', email: 'john@acme.org')
    
      case user
      in User(name: 'John Doe', email:)
        puts email
      else
        puts 'Not John'
      end
    

    See more examples in the specs.

    Compare v1.1.0...v1.1.1


Previous changes from v1.1.0

  • 1.1.0 2019-10-07

    ➕ Added

    🍱 Experimental support for pattern matching 🎉 (flash-gordon)

    User = Dry.Struct(name: 'string', email: 'string') user = User.new(name: 'John Doe', email: 'john@acme.org')case userin User({ name: 'John Doe', email: }) puts emailelseputs 'Not John'end
    

    See more examples in the specs.

    Compare v1.0.0...v1.1.0