class Puppet::Pops::Types::CountMismatch

@api private

Public Class Methods

new(path, expected, actual) click to toggle source
    # File lib/puppet/pops/types/type_mismatch_describer.rb
484 def initialize(path, expected, actual)
485   super(path, expected, actual)
486 end

Public Instance Methods

message(variant, position) click to toggle source
    # File lib/puppet/pops/types/type_mismatch_describer.rb
488 def message(variant, position)
489   min = expected.from || 0
490   max = expected.to || Float::INFINITY
491   suffix = min == 1 && (max == 1 || max == Float::INFINITY) || min == 0 && max == 1 ? '' : 's'
492   "#{variant}#{position} expects #{range_to_s(expected, 'no')} argument#{suffix}, got #{range_to_s(actual, 'none')}"
493 end