We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 051f85c commit 8ebc96fCopy full SHA for 8ebc96f
1 file changed
CHANGELOG.md
@@ -6,6 +6,17 @@
6
### Added
7
8
- Support for wrapping constructors and fallbacks, see release notes for dry-types 1.5.0 (@flash-gordon)
9
+- Improvements of the attribute DSL, now it's possible to use optional structs as a base class (@flash-gordon)
10
+ ```ruby
11
+ class User < Dry::Struct
12
+ attribute :name, Types::String
13
+ attribute :address, Dry::Struct.optional do
14
+ attribute :city, Types::String
15
+ end
16
17
+
18
+ User.new(name: "John", address: nil) # => #<User name="John" address=nil>
19
+ ```
20
21
22
[Compare v1.3.0...master](https://github.com/dry-rb/dry-struct/compare/v1.3.0...master)
0 commit comments