Skip to content

Commit 8ebc96f

Browse files
author
dry-bot
committed
[devtools] sync
1 parent 051f85c commit 8ebc96f

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@
66
### Added
77

88
- 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+
end
17+
18+
User.new(name: "John", address: nil) # => #<User name="John" address=nil>
19+
```
920

1021

1122
[Compare v1.3.0...master](https://github.com/dry-rb/dry-struct/compare/v1.3.0...master)

0 commit comments

Comments
 (0)