Sha256: 1c927d84fb4f297e9ecbad001d154c8567f3a0da0097c071c6363044710f12ba
Contents?: true
Size: 535 Bytes
Versions: 1
Compression:
Stored size: 535 Bytes
Contents
class ContractValueObject class DefinitionError < ArgumentError include Contracts ErrorMessage = Struct.new(:attribute, :message) attr_reader :error_messages Contract ArrayOf[ErrorMessage] => Any def initialize(error_messages) @error_messages = error_messages message_components = error_messages.each_with_index.map do |error, index| "#{index + 1}. `#{error.attribute}`: #{error.message}" end message = ['', *message_components].join("\n") super message end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
contract_value_object-0.1.0 | lib/contract_value_object/definition_error.rb |