class Io::Flow::V0::Models::Allocation
Attributes
details[R]
order[R]
Public Class Methods
new(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 30034 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:order, :details], 'Allocation') @order = (x = opts.delete(:order); x.is_a?(::Io::Flow::V0::Models::AllocationOrderSummary) ? x : ::Io::Flow::V0::Models::AllocationOrderSummary.new(x)) @details = HttpClient::Preconditions.assert_class('details', opts.delete(:details), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AllocationDetail) ? x : ::Io::Flow::V0::Models::AllocationDetail.from_json(x)) } end
Public Instance Methods
copy(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 30045 def copy(incoming={}) Allocation.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end
to_hash()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 30049 def to_hash { :order => order.to_hash, :details => details.map { |o| o.to_hash } } end
to_json()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 30041 def to_json JSON.dump(to_hash) end