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.



32857
32858
32859
32860
32861
32862
32863
32864
32865
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32857

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.



32855
32856
32857
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32855

def capture
  @capture
end

#idObject (readonly)

Returns the value of attribute id.



32855
32856
32857
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32855

def id
  @id
end

#identifierObject (readonly)

Returns the value of attribute identifier.



32855
32856
32857
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32855

def identifier
  @identifier
end

#nameObject (readonly)

Returns the value of attribute name.



32855
32856
32857
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32855

def name
  @name
end

#primaryObject (readonly)

Returns the value of attribute primary.



32855
32856
32857
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32855

def primary
  @primary
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



32871
32872
32873
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32871

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

#to_hashObject



32875
32876
32877
32878
32879
32880
32881
32882
32883
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32875

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

#to_jsonObject



32867
32868
32869
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32867

def to_json
  JSON.dump(to_hash)
end