Class: Ingenico::Connect::SDK::Domain::Refund::RefundErrorResponse
- Inherits:
-
Ingenico::Connect::SDK::DataObject
- Object
- Ingenico::Connect::SDK::DataObject
- Ingenico::Connect::SDK::Domain::Refund::RefundErrorResponse
- Defined in:
- lib/ingenico/connect/sdk/domain/refund/refund_error_response.rb
Instance Attribute Summary collapse
-
#error_id ⇒ String
The current value of error_id.
-
#errors ⇒ Array<Ingenico::Connect::SDK::Domain::Errors::APIError>
The current value of errors.
-
#refund_result ⇒ Ingenico::Connect::SDK::Domain::Refund::RefundResult
The current value of refund_result.
Instance Method Summary collapse
Methods inherited from Ingenico::Connect::SDK::DataObject
Instance Attribute Details
#error_id ⇒ String
Returns the current value of error_id.
16 17 18 |
# File 'lib/ingenico/connect/sdk/domain/refund/refund_error_response.rb', line 16 def error_id @error_id end |
#errors ⇒ Array<Ingenico::Connect::SDK::Domain::Errors::APIError>
Returns the current value of errors.
16 17 18 |
# File 'lib/ingenico/connect/sdk/domain/refund/refund_error_response.rb', line 16 def errors @errors end |
#refund_result ⇒ Ingenico::Connect::SDK::Domain::Refund::RefundResult
Returns the current value of refund_result.
16 17 18 |
# File 'lib/ingenico/connect/sdk/domain/refund/refund_error_response.rb', line 16 def refund_result @refund_result end |
Instance Method Details
#from_hash(hash) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/ingenico/connect/sdk/domain/refund/refund_error_response.rb', line 33 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 << Ingenico::Connect::SDK::Domain::Errors::APIError.new_from_hash(e) end end if hash.has_key? 'refundResult' raise TypeError, "value '%s' is not a Hash" % [hash['refundResult']] unless hash['refundResult'].is_a? Hash @refund_result = Ingenico::Connect::SDK::Domain::Refund::RefundResult.new_from_hash(hash['refundResult']) end end |
#to_h ⇒ Hash
25 26 27 28 29 30 31 |
# File 'lib/ingenico/connect/sdk/domain/refund/refund_error_response.rb', line 25 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['refundResult'] = @refund_result.to_h unless @refund_result.nil? hash end |