Skip to content

Commit

Permalink
Merge pull request #482 from timhwang21/timhwang/update-readme
Browse files Browse the repository at this point in the history
Update docsite with instructions on sum types
  • Loading branch information
solnic authored Oct 25, 2024
2 parents ced2c60 + e962d49 commit c25862f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docsite/source/basics/macros.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ Dry::Schema.Params do
end
```

Predicates passed as an array will be `OR`-ed automatically:

```ruby
Dry::Schema.Params do
# expands to `required(:id) { str? | int? }`
required(:id).value([:string, :integer])
end
```

### filled

Use it when a value is expected to be filled. "filled" means that the value is non-nil and, in the case of a `String`, `Hash`, or `Array` value, that the value is not `.empty?`.
Expand Down

0 comments on commit c25862f

Please sign in to comment.