dry-struct v0.6.0 Release Notes

Release Date: 2019-03-22 // over 2 years ago
  • ➕ Added

    • Struct.attribute? is an easy way to define omittable attributes (flash-gordon):
      class User < Dry::Struct
        attribute  :name,  Types::Strict::String
        attribute? :email, Types::Strict::String
      end
      # User.new(name: 'John') # => #<User name="John">
    

    🛠 Fixed

    • Struct#to_h recursively converts hash values to hashes, this was done to be consistent with current behavior for arrays (oeoeaio + ZimbiX)

    🔄 Changed

    • 🗄 [BREAKING] Struct.attribute? in the old sense is deprecated, use has_attribute? as a replacement

    Compare v0.5.1...v0.6.0