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.

API:

  • public

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:

  • The default message

  • The expected type

  • The actual type

API:

  • public



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

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:

  • actual type

API:

  • public



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

def actual_type
  @actual_type
end

#expected_typePAnyType (readonly)

Returns the expected type

Returns:

  • expected type

API:

  • public



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

def expected_type
  @expected_type
end