Class: Puppet::Pops::Types::PatternMismatch
- Inherits:
-
TypeMismatch
- Object
- Mismatch
- ExpectedActualMismatch
- TypeMismatch
- Puppet::Pops::Types::PatternMismatch
- Defined in:
- lib/puppet/pops/types/type_mismatch_describer.rb
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
Methods inherited from TypeMismatch
Methods included from LabelProvider
#a_an, #a_an_uc, #label, #plural_s, #the, #the_uc
Methods inherited from ExpectedActualMismatch
Methods inherited from Mismatch
#==, #canonical_path, #chop_path, #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
256 257 258 259 |
# File 'lib/puppet/pops/types/type_mismatch_describer.rb', line 256 def actual_string a = actual a.is_a?(PStringType) && a.values.size == 1 ? "'#{a.values[0]}'" : a.simple_name end |
#message(variant, position) ⇒ Object
252 253 254 |
# File 'lib/puppet/pops/types/type_mismatch_describer.rb', line 252 def (variant, position) "#{variant}#{position} expects a match for #{expected}, got #{actual_string}" end |