class Io::Flow::V0::Models::DeliveryWindowComponentsV2
Components and information taken into account when calculating a final delivery window
Attributes
processing_estimates[R]
transit_estimates[R]
Public Class Methods
new(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 39363 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:processing_estimates, :transit_estimates], 'DeliveryWindowComponentsV2') @processing_estimates = HttpClient::Preconditions.assert_class('processing_estimates', opts.delete(:processing_estimates), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ProcessingEstimate) ? x : ::Io::Flow::V0::Models::ProcessingEstimate.new(x)) } @transit_estimates = HttpClient::Preconditions.assert_class('transit_estimates', opts.delete(:transit_estimates), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::TransitEstimate) ? x : ::Io::Flow::V0::Models::TransitEstimate.new(x)) } end
Public Instance Methods
copy(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 39374 def copy(incoming={}) DeliveryWindowComponentsV2.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 39378 def to_hash { :processing_estimates => processing_estimates.map { |o| o.to_hash }, :transit_estimates => transit_estimates.map { |o| o.to_hash } } end
to_json()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 39370 def to_json JSON.dump(to_hash) end