Class: Worldline::Connect::SDK::V1::Domain::ErrorResponse
- Inherits:
-
Domain::DataObject
- Object
- Domain::DataObject
- Worldline::Connect::SDK::V1::Domain::ErrorResponse
- Defined in:
- lib/worldline/connect/sdk/v1/domain/error_response.rb
Instance Attribute Summary collapse
-
#error_id ⇒ String
The current value of error_id.
-
#errors ⇒ Array<Worldline::Connect::SDK::V1::Domain::APIError>
The current value of errors.
Instance Method Summary collapse
Methods inherited from Domain::DataObject
Instance Attribute Details
#error_id ⇒ String
Returns the current value of error_id.
15 16 17 |
# File 'lib/worldline/connect/sdk/v1/domain/error_response.rb', line 15 def error_id @error_id end |
#errors ⇒ Array<Worldline::Connect::SDK::V1::Domain::APIError>
Returns the current value of errors.
15 16 17 |
# File 'lib/worldline/connect/sdk/v1/domain/error_response.rb', line 15 def errors @errors end |
Instance Method Details
#from_hash(hash) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/worldline/connect/sdk/v1/domain/error_response.rb', line 29 def from_hash(hash) super if hash.has_key? 'errorId' @error_id = hash['errorId'] end if hash.has_key? 'errors' raise TypeError, "value '%s' is not an Array" % [hash['errors']] unless hash['errors'].is_a? Array @errors = [] hash['errors'].each do |e| @errors << Worldline::Connect::SDK::V1::Domain::APIError.new_from_hash(e) end end end |
#to_h ⇒ Hash
22 23 24 25 26 27 |
# File 'lib/worldline/connect/sdk/v1/domain/error_response.rb', line 22 def to_h hash = super hash['errorId'] = @error_id unless @error_id.nil? hash['errors'] = @errors.collect{|val| val.to_h} unless @errors.nil? hash end |