Exception: ContractValueObject::DefinitionError
- Inherits:
-
ArgumentError
- Object
- ArgumentError
- ContractValueObject::DefinitionError
- Includes:
- Contracts
- Defined in:
- lib/contract_value_object/definition_error.rb
Defined Under Namespace
Classes: ErrorMessage
Instance Attribute Summary collapse
-
#error_messages ⇒ Object
readonly
Returns the value of attribute error_messages.
Instance Method Summary collapse
-
#initialize(error_messages) ⇒ DefinitionError
constructor
A new instance of DefinitionError.
Constructor Details
#initialize(error_messages) ⇒ DefinitionError
Returns a new instance of DefinitionError.
9 10 11 12 13 14 15 16 17 |
# File 'lib/contract_value_object/definition_error.rb', line 9 def initialize() = = .each_with_index.map do |error, index| "#{index + 1}. `#{error.attribute}`: #{error.message}" end = ['', *].join("\n") super end |
Instance Attribute Details
#error_messages ⇒ Object (readonly)
Returns the value of attribute error_messages.
6 7 8 |
# File 'lib/contract_value_object/definition_error.rb', line 6 def end |