Class: Puppet::Pops::Types::PatternMismatch Private
- Inherits:
-
TypeMismatch
- Object
- Mismatch
- ExpectedActualMismatch
- TypeMismatch
- Puppet::Pops::Types::PatternMismatch
- Defined in:
- lib/puppet/pops/types/type_mismatch_describer.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Constant Summary
Constants included from LabelProvider
LabelProvider::A, LabelProvider::AN, LabelProvider::SKIPPED_CHARACTERS, LabelProvider::VOWELS
Instance Attribute Summary
Attributes inherited from ExpectedActualMismatch
Attributes inherited from Mismatch
Instance Method Summary collapse
- #actual_string ⇒ Object private
- #message(variant, position) ⇒ Object private
Methods inherited from TypeMismatch
Methods included from LabelProvider
#a_an, #a_an_uc, #article, #combine_strings, #label, #plural_s, #the, #the_uc
Methods inherited from ExpectedActualMismatch
Methods inherited from Mismatch
#==, #canonical_path, #chop_path, #eql?, #format, #hash, #initialize, #merge, #path_string, #to_s
Constructor Details
This class inherits a constructor from Puppet::Pops::Types::ExpectedActualMismatch
Instance Method Details
#actual_string ⇒ 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.
444 445 446 447 |
# File 'lib/puppet/pops/types/type_mismatch_describer.rb', line 444 def actual_string a = actual a.is_a?(PStringType) && !a.value.nil? ? "'#{a.value}'" : short_name(a) end |
#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.
434 435 436 437 438 439 440 441 442 |
# File 'lib/puppet/pops/types/type_mismatch_describer.rb', line 434 def (variant, position) e = expected value_pfx = '' if e.is_a?(POptionalType) e = e.optional_type value_pfx = 'an undef value or ' end "#{variant}#{position} expects #{value_pfx}a match for #{e.}, got #{actual_string}" end |