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.



18428
18429
18430
18431
18432
18433
18434
18435
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18428

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :capture, :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))
  @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.



18426
18427
18428
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18426

def capture
  @capture
end

#idObject (readonly)

Returns the value of attribute id.



18426
18427
18428
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18426

def id
  @id
end

#identifierObject (readonly)

Returns the value of attribute identifier.



18426
18427
18428
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18426

def identifier
  @identifier
end

#primaryObject (readonly)

Returns the value of attribute primary.



18426
18427
18428
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18426

def primary
  @primary
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



18441
18442
18443
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18441

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

#to_hashObject



18445
18446
18447
18448
18449
18450
18451
18452
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18445

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

#to_jsonObject



18437
18438
18439
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18437

def to_json
  JSON.dump(to_hash)
end