Method: Puppet::Pops::Types::CountMismatch#message

Defined in:
lib/puppet/pops/types/type_mismatch_describer.rb

#message(variant, position) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



487
488
489
490
491
492
# File 'lib/puppet/pops/types/type_mismatch_describer.rb', line 487

def message(variant, position)
  min = expected.from || 0
  max = expected.to || Float::INFINITY
  suffix = min == 1 && (max == 1 || max == Float::INFINITY) || min == 0 && max == 1 ? '' : 's'
  "#{variant}#{position} expects #{range_to_s(expected, 'no')} argument#{suffix}, got #{range_to_s(actual, 'none')}"
end