Class: Io::Flow::V0::Models::CaptureError
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CaptureError
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#decline_code ⇒ Object
readonly
Returns the value of attribute decline_code.
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CaptureError
constructor
A new instance of CaptureError.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ CaptureError
Returns a new instance of CaptureError.
13476 13477 13478 13479 13480 13481 13482 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13476 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:messages, :decline_code], 'CaptureError') @code = (x = (x = opts.delete(:code); x.nil? ? "generic_error" : x); x.is_a?(::Io::Flow::V0::Models::GenericErrorCode) ? x : ::Io::Flow::V0::Models::GenericErrorCode.apply(x)) @messages = HttpClient::Preconditions.assert_class('messages', opts.delete(:messages), Array).map { |v| HttpClient::Preconditions.assert_class('messages', v, String) } @decline_code = (x = opts.delete(:decline_code); x.is_a?(::Io::Flow::V0::Models::CaptureDeclineCode) ? x : ::Io::Flow::V0::Models::CaptureDeclineCode.apply(x)) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
13474 13475 13476 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13474 def code @code end |
#decline_code ⇒ Object (readonly)
Returns the value of attribute decline_code.
13474 13475 13476 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13474 def decline_code @decline_code end |
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
13474 13475 13476 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13474 def @messages end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
13488 13489 13490 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13488 def copy(incoming={}) CaptureError.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
13492 13493 13494 13495 13496 13497 13498 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13492 def to_hash { :code => code.value, :messages => , :decline_code => decline_code.value } end |
#to_json ⇒ Object
13484 13485 13486 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13484 def to_json JSON.dump(to_hash) end |