Sha256: edd41a5c55ed9c71350f7ef48e9e9892de68b2bb1d570acedd5ea756196e9a65
Contents?: true
Size: 786 Bytes
Versions: 5
Compression:
Stored size: 786 Bytes
Contents
# typed: false # frozen_string_literal: true require 'clean_architecture/types' require 'dry/struct' module CleanArchitecture module Entities class FailureDetails < Dry::Struct FailureTypes = Types::Strict::String.enum( 'error', 'expectation_failed', 'not_found', 'unauthorized', 'unprocessable_entity' ) attribute :type, FailureTypes attribute :message, Types::Strict::String attribute :other_properties, Types::Strict::Hash.default({}.freeze) def self.from_array(array) new(message: array.map(&:to_s).join(', '), other_properties: {}, type: 'error') end def self.from_string(string) new(message: string, other_properties: {}, type: 'error') end end end end
Version data entries
5 entries across 5 versions & 1 rubygems