dry-struct v0.6.0 Release Notes

Release Date: 2019-03-22 // over 3 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