Class: Io::Flow::V0::Models::OrderSubmissionForm

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

Overview

Optional data to be processed during order submission

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ OrderSubmissionForm

Returns a new instance of OrderSubmissionForm.



50280
50281
50282
50283
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50280

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @identifiers = HttpClient::Preconditions.assert_class('identifiers', (x = opts.delete(:identifiers); x.nil? ? [] : x), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::OrderSubmissionIdentifierForm) ? x : ::Io::Flow::V0::Models::OrderSubmissionIdentifierForm.new(x)) }
end

Instance Attribute Details

#identifiersObject (readonly)

Returns the value of attribute identifiers.



50278
50279
50280
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50278

def identifiers
  @identifiers
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



50289
50290
50291
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50289

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

#to_hashObject



50293
50294
50295
50296
50297
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50293

def to_hash
  {
    :identifiers => identifiers.map { |o| o.to_hash }
  }
end

#to_jsonObject



50285
50286
50287
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50285

def to_json
  JSON.dump(to_hash)
end