Class: CleanArchitecture::Entities::FailureDetails

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Includes:
T::Struct::ActsAsComparable
Defined in:
lib/clean_architecture/entities/failure_details.rb

Class Method Summary collapse

Class Method Details

.from_array(array) ⇒ Object



25
26
27
28
29
30
# File 'lib/clean_architecture/entities/failure_details.rb', line 25

def self.from_array(array)
  new(
    message: array.map(&:to_s).join(', '),
    type: FailureType::Error
  )
end

.from_string(string) ⇒ Object



33
34
35
36
37
38
# File 'lib/clean_architecture/entities/failure_details.rb', line 33

def self.from_string(string)
  new(
    message: string,
    type: FailureType::Error
  )
end