Class: Io::Flow::V0::Models::RefundIdentifier
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::RefundIdentifier
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#primary ⇒ Object
readonly
Returns the value of attribute primary.
-
#refund ⇒ Object
readonly
Returns the value of attribute refund.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ RefundIdentifier
constructor
A new instance of RefundIdentifier.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ RefundIdentifier
Returns a new instance of RefundIdentifier.
46494 46495 46496 46497 46498 46499 46500 46501 46502 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46494 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :refund, :name, :identifier, :primary], 'RefundIdentifier') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @refund = (x = opts.delete(:refund); x.is_a?(::Io::Flow::V0::Models::RefundReference) ? x : ::Io::Flow::V0::Models::RefundReference.new(x)) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @identifier = HttpClient::Preconditions.assert_class('identifier', opts.delete(:identifier), String) @primary = HttpClient::Preconditions.assert_boolean('primary', opts.delete(:primary)) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
46492 46493 46494 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46492 def id @id end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
46492 46493 46494 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46492 def identifier @identifier end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
46492 46493 46494 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46492 def name @name end |
#primary ⇒ Object (readonly)
Returns the value of attribute primary.
46492 46493 46494 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46492 def primary @primary end |
#refund ⇒ Object (readonly)
Returns the value of attribute refund.
46492 46493 46494 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46492 def refund @refund end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
46508 46509 46510 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46508 def copy(incoming={}) RefundIdentifier.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
46512 46513 46514 46515 46516 46517 46518 46519 46520 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46512 def to_hash { :id => id, :refund => refund.to_hash, :name => name, :identifier => identifier, :primary => primary } end |
#to_json ⇒ Object
46504 46505 46506 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46504 def to_json JSON.dump(to_hash) end |