Exception: Puppet::Pops::Types::TypeAssertionError

Inherits:
Error
  • Object
show all
Defined in:
lib/puppet/pops/types/type_assertion_error.rb

Overview

Raised when an assertion of actual type against an expected type fails.

Instance Attribute Summary collapse

Attributes inherited from Error

#original

Instance Method Summary collapse

Constructor Details

#initialize(message, expected_type, actual_type) ⇒ TypeAssertionError

Creates a new instance with a default message, expected, and actual types,

Parameters:

  • message (String)

    The default message

  • expected_type (PAnyType)

    The expected type

  • actual_type (PAnyType)

    The actual type



21
22
23
24
25
# File 'lib/puppet/pops/types/type_assertion_error.rb', line 21

def initialize(message, expected_type, actual_type)
  super(message)
  @expected_type = expected_type
  @actual_type = actual_type
end

Instance Attribute Details

#actual_typePAnyType (readonly)

Returns the actual type

Returns:



13
14
15
# File 'lib/puppet/pops/types/type_assertion_error.rb', line 13

def actual_type
  @actual_type
end

#expected_typePAnyType (readonly)

Returns the expected type

Returns:



9
10
11
# File 'lib/puppet/pops/types/type_assertion_error.rb', line 9

def expected_type
  @expected_type
end