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.



21737
21738
21739
21740
21741
21742
21743
21744
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21737

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.



21735
21736
21737
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21735

def capture
  @capture
end

#idObject (readonly)

Returns the value of attribute id.



21735
21736
21737
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21735

def id
  @id
end

#identifierObject (readonly)

Returns the value of attribute identifier.



21735
21736
21737
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21735

def identifier
  @identifier
end

#primaryObject (readonly)

Returns the value of attribute primary.



21735
21736
21737
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21735

def primary
  @primary
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



21750
21751
21752
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21750

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

#to_hashObject



21754
21755
21756
21757
21758
21759
21760
21761
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21754

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

#to_jsonObject



21746
21747
21748
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21746

def to_json
  JSON.dump(to_hash)
end