Class: Io::Flow::V0::Models::OrderSubmissionIdentifierForm

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

Overview

Defines the data needed to attach an identifer to each order created by a checkout.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ OrderSubmissionIdentifierForm

Returns a new instance of OrderSubmissionIdentifierForm.



40724
40725
40726
40727
40728
40729
40730
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40724

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:identifier], 'OrderSubmissionIdentifierForm')
  @identifier = HttpClient::Preconditions.assert_class('identifier', opts.delete(:identifier), String)
  @name = (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_class('name', x, String))
  @primary = (x = opts.delete(:primary); x.nil? ? nil : HttpClient::Preconditions.assert_boolean('primary', x))
end

Instance Attribute Details

#identifierObject (readonly)

Returns the value of attribute identifier.



40722
40723
40724
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40722

def identifier
  @identifier
end

#nameObject (readonly)

Returns the value of attribute name.



40722
40723
40724
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40722

def name
  @name
end

#primaryObject (readonly)

Returns the value of attribute primary.



40722
40723
40724
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40722

def primary
  @primary
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



40736
40737
40738
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40736

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

#to_hashObject



40740
40741
40742
40743
40744
40745
40746
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40740

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

#to_jsonObject



40732
40733
40734
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40732

def to_json
  JSON.dump(to_hash)
end