Exception: ContractBaseError
- Inherits:
-
ArgumentError
- Object
- ArgumentError
- ContractBaseError
- Defined in:
- lib/contracts/errors.rb
Overview
Base class for Contract errors
If default failure callback is used it stores failure data
Direct Known Subclasses
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(message, data) ⇒ ContractBaseError
constructor
A new instance of ContractBaseError.
-
#to_contract_error ⇒ Object
Used to convert to simple ContractError from other contract errors.
Constructor Details
#initialize(message, data) ⇒ ContractBaseError
Returns a new instance of ContractBaseError.
8 9 10 11 |
# File 'lib/contracts/errors.rb', line 8 def initialize(, data) super() @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
6 7 8 |
# File 'lib/contracts/errors.rb', line 6 def data @data end |
Instance Method Details
#to_contract_error ⇒ Object
Used to convert to simple ContractError from other contract errors
14 15 16 |
# File 'lib/contracts/errors.rb', line 14 def to_contract_error self end |