Module: Contract::ContractException

Included in:
ContractError, ContractMismatch
Defined in:
lib/contract/exception.rb

Overview

Exceptions raised by Contract contain some useful meta-information. This module is mixed into Exceptions that provide such information.

Instance Attribute Summary collapse

Instance Attribute Details

#original_messageObject (readonly)

The original, unfiltered exception message.



35
36
37
# File 'lib/contract/exception.rb', line 35

def original_message
  @original_message
end

#test_contractObject (readonly)

What contract was that method part of?



33
34
35
# File 'lib/contract/exception.rb', line 33

def test_contract
  @test_contract
end

#test_methodObject (readonly)

What method implemented that test?



31
32
33
# File 'lib/contract/exception.rb', line 31

def test_method
  @test_method
end

#test_objectObject (readonly)

What object was tested when this Exception was raised?



29
30
31
# File 'lib/contract/exception.rb', line 29

def test_object
  @test_object
end