Class: Ingenico::Direct::SDK::Domain::PayoutErrorResponse
- Inherits:
-
Ingenico::Direct::SDK::DataObject
- Object
- Ingenico::Direct::SDK::DataObject
- Ingenico::Direct::SDK::Domain::PayoutErrorResponse
- Defined in:
- lib/ingenico/direct/sdk/domain/payout_error_response.rb
Instance Attribute Summary collapse
-
#error_id ⇒ String
The current value of error_id.
-
#errors ⇒ Array<Ingenico::Direct::SDK::Domain::APIError>
The current value of errors.
-
#payout_result ⇒ Ingenico::Direct::SDK::Domain::PayoutResult
The current value of payout_result.
Instance Method Summary collapse
Methods inherited from Ingenico::Direct::SDK::DataObject
Instance Attribute Details
#error_id ⇒ String
Returns the current value of error_id.
15 16 17 |
# File 'lib/ingenico/direct/sdk/domain/payout_error_response.rb', line 15 def error_id @error_id end |
#errors ⇒ Array<Ingenico::Direct::SDK::Domain::APIError>
Returns the current value of errors.
15 16 17 |
# File 'lib/ingenico/direct/sdk/domain/payout_error_response.rb', line 15 def errors @errors end |
#payout_result ⇒ Ingenico::Direct::SDK::Domain::PayoutResult
Returns the current value of payout_result.
15 16 17 |
# File 'lib/ingenico/direct/sdk/domain/payout_error_response.rb', line 15 def payout_result @payout_result end |
Instance Method Details
#from_hash(hash) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/ingenico/direct/sdk/domain/payout_error_response.rb', line 29 def from_hash(hash) super @error_id = hash['errorId'] if hash.key? 'errorId' if hash.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 << Ingenico::Direct::SDK::Domain::APIError.new_from_hash(e) end end if hash.key? 'payoutResult' raise TypeError, "value '%s' is not a Hash" % [hash['payoutResult']] unless hash['payoutResult'].is_a? Hash @payout_result = Ingenico::Direct::SDK::Domain::PayoutResult.new_from_hash(hash['payoutResult']) end end |
#to_h ⇒ Hash
21 22 23 24 25 26 27 |
# File 'lib/ingenico/direct/sdk/domain/payout_error_response.rb', line 21 def to_h hash = super hash['errorId'] = @error_id unless @error_id.nil? hash['errors'] = @errors.collect(&:to_h) if @errors hash['payoutResult'] = @payout_result.to_h if @payout_result hash end |