dry-types v0.6.0 Release Notes

Release Date: 2016-03-16 // about 8 years ago
  • 📇 Renamed from dry-data to dry-types and:

    ➕ Added

    • Dry::Types.module which returns a namespace for inclusion which has all built-in types defined as constants (solnic)
    • 0️⃣ Hash#schema supports default values now (solnic)
    • Hash#symbolized passes through keys that are already symbols (solnic)
    • 0️⃣ Struct.new uses an empty hash by default as input (solnic)
    • Struct.constructor_type macro can be used to change attributes constructor (solnic)
    • 0️⃣ default accepts a block now for dynamic values (solnic)
    • Types.register_class accepts a second arg which is the name of the class' constructor method, defaults to :new (solnic)

    🛠 Fixed

    • Struct will simply pass-through the input if it is already a struct (solnic)
    • 0️⃣ default will raise if a value violates constraints (solnic)
    • 0️⃣ Evaluating a default value tries to use type's constructor which makes it work with types that may coerce an input into nil (solnic)
    • enum works just fine with integer-values (solnic)
    • 0️⃣ enum + default works just fine (solnic)
    • Optional no longer responds to primitive as it makes no sense since there's no single primitive for an optional value (solnic)
    • Optional passes-through a value which is already a maybe (solnic)

    🔄 Changed

    • Dry::Types::Definition is now the base type definition object (solnic)
    • Dry::Types::Constructor is now a type definition with a constructor function (solnic)

    Compare v0.5.1...v0.6.0