Skip to content

Commit

Permalink
Merge pull request #83 from dry-rb/fix/docs
Browse files Browse the repository at this point in the history
Fix documentation for unknown arguments (#68)
  • Loading branch information
solnic committed Mar 25, 2021
2 parents 8db20d8 + 3cd33ac commit 269a4f1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 28 deletions.
2 changes: 1 addition & 1 deletion docsite/source/index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: dry-initializer
sections:
- container-version
- params-and-options
- options-tolerance
- tolerance-to-unknown-arguments
- optionals-and-defaults
- type-constraints
- readers
Expand Down
27 changes: 0 additions & 27 deletions docsite/source/options-tolerance.html.md

This file was deleted.

22 changes: 22 additions & 0 deletions docsite/source/tolerance-to-unknown-arguments.html.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: Tolerance to Unknown Arguments
layout: gem-single
name: dry-initializer
---

By default the initializer is tolerant for both params (positional arguments) and options.
All unknown arguments of the initializer are ignored silently.

```ruby
require 'dry-initializer'

class User
extend Dry::Initializer
end

user = User.new 'Joe', role: 'admin'
user.respond_to? :role # => false

User.dry_initializer.attributes(user)
# => {}
```

0 comments on commit 269a4f1

Please sign in to comment.