Class: Io::Flow::V0::Models::OrderInformationFlow

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

Instance Attribute Summary collapse

Attributes inherited from OrderInformation

#type

Instance Method Summary collapse

Methods inherited from OrderInformation

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ OrderInformationFlow

Returns a new instance of OrderInformationFlow.



46379
46380
46381
46382
46383
46384
46385
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46379

def initialize(incoming={})
  super(:type => OrderInformation::Types::ORDER_INFORMATION_FLOW)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:order_number], 'OrderInformationFlow')
  @order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String)
  @billing_address = (x = opts.delete(:billing_address); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::PaymentAddressBilling) ? x : ::Io::Flow::V0::Models::PaymentAddressBilling.new(x)))
end

Instance Attribute Details

#billing_addressObject (readonly)

Returns the value of attribute billing_address.



46377
46378
46379
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46377

def billing_address
  @billing_address
end

#order_numberObject (readonly)

Returns the value of attribute order_number.



46377
46378
46379
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46377

def order_number
  @order_number
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



46391
46392
46393
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46391

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

#subtype_to_hashObject



46395
46396
46397
46398
46399
46400
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46395

def subtype_to_hash
  {
    :order_number => order_number,
    :billing_address => billing_address.nil? ? nil : billing_address.to_hash
  }
end

#to_jsonObject



46387
46388
46389
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46387

def to_json
  JSON.dump(to_hash)
end