module T::Props::Constructor
def initialize(hash={})
def initialize(hash={}) decorator = self.class.decorator decorator.props.each do |prop, rules| # It's important to explicitly compare against `true` here; the value can also be :existing or # :on_load (which are truthy) but we don't want to treat those as optional in this context. if T::Props::Utils.required_prop?(rules) && !decorator.has_default?(rules) && !hash.key?(prop) raise ArgumentError.new("Missing required prop `#{prop}` for class `#{self.class}`") end end super end