Class: Io::Flow::V0::Models::PaymentCaptureStatus
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PaymentCaptureStatus
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ PaymentCaptureStatus
constructor
A new instance of PaymentCaptureStatus.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ PaymentCaptureStatus
Returns a new instance of PaymentCaptureStatus.
56582 56583 56584 56585 56586 56587 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56582 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:status], 'PaymentCaptureStatus') @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::CaptureStatus) ? x : ::Io::Flow::V0::Models::CaptureStatus.apply(x)) @reason = (x = opts.delete(:reason); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::CaptureDeclineCode) ? x : ::Io::Flow::V0::Models::CaptureDeclineCode.apply(x))) end |
Instance Attribute Details
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
56580 56581 56582 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56580 def reason @reason end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
56580 56581 56582 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56580 def status @status end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
56593 56594 56595 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56593 def copy(incoming={}) PaymentCaptureStatus.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
56597 56598 56599 56600 56601 56602 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56597 def to_hash { :status => status.value, :reason => reason.nil? ? nil : reason.value } end |
#to_json ⇒ Object
56589 56590 56591 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56589 def to_json JSON.dump(to_hash) end |