Sha256: 94fa588974321e9b44a3db1bf07486412d1bde9755d690efbc456474d63ffd71
Contents?: true
Size: 558 Bytes
Versions: 2
Compression:
Stored size: 558 Bytes
Contents
--- title: Tolerance to Unknown Options layout: gem-single name: dry-initializer --- By default the initializer is strict for params (positional arguments), expecting them to be defined explicitly. ```ruby require 'dry-initializer' class User extend Dry::Initializer end user = User.new 'Joe' # raises ArgumentError ``` At the same time it is tolerant to unknown options. All unknown options are accepted, but ignored: ```ruby # It accepts undefined options... user = User.new name: 'Joe' # ...but ignores them user.respond_to? :name # => false ```
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
dry-initializer-3.0.3 | docsite/source/options-tolerance.html.md |
dry-initializer-3.0.2 | docsite/source/options-tolerance.html.md |