module T::Props::WeakConstructor::DecoratorMethods

def construct_props_with_defaults(instance, hash)

def construct_props_with_defaults(instance, hash)
  @props_with_defaults&.count do |p, default_struct|
    if hash.key?(p)
      instance.instance_exec(hash[p], &default_struct.setter_proc)
      true
    else
      default_struct.set_default(instance)
      false
    end
  end || 0
end

def construct_props_without_defaults(instance, hash)

def construct_props_without_defaults(instance, hash)
  @props_without_defaults&.count do |p, setter_proc|
    if hash.key?(p)
      instance.instance_exec(hash[p], &setter_proc)
      true
    else
      false
    end
  end || 0
end