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 identifier 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.



41427
41428
41429
41430
41431
41432
41433
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41427

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.



41425
41426
41427
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41425

def identifier
  @identifier
end

#nameObject (readonly)

Returns the value of attribute name.



41425
41426
41427
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41425

def name
  @name
end

#primaryObject (readonly)

Returns the value of attribute primary.



41425
41426
41427
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41425

def primary
  @primary
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



41439
41440
41441
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41439

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

#to_hashObject



41443
41444
41445
41446
41447
41448
41449
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41443

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

#to_jsonObject



41435
41436
41437
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41435

def to_json
  JSON.dump(to_hash)
end