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.



38881
38882
38883
38884
38885
38886
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38881

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)
  @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.



38879
38880
38881
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38879

def identifier
  @identifier
end

#primaryObject (readonly)

Returns the value of attribute primary.



38879
38880
38881
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38879

def primary
  @primary
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



38892
38893
38894
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38892

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

#to_hashObject



38896
38897
38898
38899
38900
38901
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38896

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

#to_jsonObject



38888
38889
38890
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38888

def to_json
  JSON.dump(to_hash)
end