Subclassing preserves all definitions being made inside a superclass.

require 'dry-initializer'

class User
  extend Dry::Initializer

  param :name

class Employee < User
  param :position

employee ='John', 'supercargo')     # => 'John'
employee.position # => 'supercargo'

employee = # => fails because type

You can override params and options. Such overriding leaves initial order of params (positional arguments) unchanged:

class Employee < User
  param :position, optional: true
  param :name,     default:  proc { 'Unknown' }

user =         # => Boom! because User#name is required
employee = # passes because who cares on employee's name
# => 'Unknown' because it is the name that positioned first like in User

octocatEdit on GitHub