Class: Io::Flow::V0::Models::CaptureIdentifier

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ CaptureIdentifier

Returns a new instance of CaptureIdentifier.



23246
23247
23248
23249
23250
23251
23252
23253
23254
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23246

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

#captureObject (readonly)

Returns the value of attribute capture.



23244
23245
23246
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23244

def capture
  @capture
end

#idObject (readonly)

Returns the value of attribute id.



23244
23245
23246
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23244

def id
  @id
end

#identifierObject (readonly)

Returns the value of attribute identifier.



23244
23245
23246
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23244

def identifier
  @identifier
end

#nameObject (readonly)

Returns the value of attribute name.



23244
23245
23246
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23244

def name
  @name
end

#primaryObject (readonly)

Returns the value of attribute primary.



23244
23245
23246
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23244

def primary
  @primary
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



23260
23261
23262
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23260

def copy(incoming={})
  CaptureIdentifier.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



23264
23265
23266
23267
23268
23269
23270
23271
23272
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23264

def to_hash
  {
    :id => id,
    :capture => capture.to_hash,
    :name => name,
    :identifier => identifier,
    :primary => primary
  }
end

#to_jsonObject



23256
23257
23258
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23256

def to_json
  JSON.dump(to_hash)
end