class Puppet::Pops::Types::CountMismatch
@api private
Public Class Methods
new(path, expected, actual)
click to toggle source
Calls superclass method
Puppet::Pops::Types::ExpectedActualMismatch::new
# File lib/puppet/pops/types/type_mismatch_describer.rb 485 def initialize(path, expected, actual) 486 super(path, expected, actual) 487 end
Public Instance Methods
message(variant, position)
click to toggle source
# File lib/puppet/pops/types/type_mismatch_describer.rb 489 def message(variant, position) 490 min = expected.from || 0 491 max = expected.to || Float::INFINITY 492 suffix = min == 1 && (max == 1 || max == Float::INFINITY) || min == 0 && max == 1 ? '' : 's' 493 "#{variant}#{position} expects #{range_to_s(expected, 'no')} argument#{suffix}, got #{range_to_s(actual, 'none')}" 494 end