Class: Io::Flow::V0::Models::CaptureIdentifier
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CaptureIdentifier
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#capture ⇒ Object
readonly
Returns the value of attribute capture.
-
#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.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CaptureIdentifier
constructor
A new instance of CaptureIdentifier.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ CaptureIdentifier
Returns a new instance of CaptureIdentifier.
25053 25054 25055 25056 25057 25058 25059 25060 25061 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25053 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :capture, :name, :identifier, :primary], 'CaptureIdentifier') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @capture = (x = opts.delete(:capture); x.is_a?(::Io::Flow::V0::Models::CaptureReference) ? x : ::Io::Flow::V0::Models::CaptureReference.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
#capture ⇒ Object (readonly)
Returns the value of attribute capture.
25051 25052 25053 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25051 def capture @capture end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
25051 25052 25053 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25051 def id @id end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
25051 25052 25053 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25051 def identifier @identifier end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
25051 25052 25053 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25051 def name @name end |
#primary ⇒ Object (readonly)
Returns the value of attribute primary.
25051 25052 25053 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25051 def primary @primary end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
25067 25068 25069 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25067 def copy(incoming={}) CaptureIdentifier.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
25071 25072 25073 25074 25075 25076 25077 25078 25079 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25071 def to_hash { :id => id, :capture => capture.to_hash, :name => name, :identifier => identifier, :primary => primary } end |
#to_json ⇒ Object
25063 25064 25065 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25063 def to_json JSON.dump(to_hash) end |