Skip to content

Commit

Permalink
Fix documentation for unknown arguments (#68)
Browse files Browse the repository at this point in the history
Fixes the issue #68
  • Loading branch information
nepalez authored and solnic committed Mar 25, 2021
1 parent b3bf36a commit f174744
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 f174744

Please sign in to comment.