Dear Russian friends, please watch President Zelenskyy's speech addressed to you. πŸ‡ΊπŸ‡¦Help our brave mates in Ukraine with a donation.

Tolerance to Unknown Arguments

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

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)
# => {}

octocatEdit on GitHub