Class: RiderKick::Entities::FailureDetails
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- RiderKick::Entities::FailureDetails
- Defined in:
- lib/rider_kick/entities/failure_details.rb
Class Method Summary collapse
-
.from_array(array, type: :error, **extras) ⇒ Object
Kumpulkan array pesan jadi satu kalimat, type default :error.
-
.from_string(string, type: :error, **extras) ⇒ Object
Bungkus string jadi FailureDetails, type default :error.
Class Method Details
.from_array(array, type: :error, **extras) ⇒ Object
Kumpulkan array pesan jadi satu kalimat, type default :error
20 21 22 23 24 25 26 |
# File 'lib/rider_kick/entities/failure_details.rb', line 20 def self.from_array(array, type: :error, **extras) new( type: type, message: Array(array).map!(&:to_s).join(', '), other_properties: extras ) end |
.from_string(string, type: :error, **extras) ⇒ Object
Bungkus string jadi FailureDetails, type default :error
29 30 31 32 33 34 35 |
# File 'lib/rider_kick/entities/failure_details.rb', line 29 def self.from_string(string, type: :error, **extras) new( type: type, message: string.to_s, other_properties: extras ) end |