Class: Io::Flow::V0::Models::DeliveryWindowComponents
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::DeliveryWindowComponents
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Components and information taken into account when calculating a final delivery window.
Instance Attribute Summary collapse
-
#shipment_estimate ⇒ Object
readonly
Returns the value of attribute shipment_estimate.
-
#transit_estimate ⇒ Object
readonly
Returns the value of attribute transit_estimate.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ DeliveryWindowComponents
constructor
A new instance of DeliveryWindowComponents.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ DeliveryWindowComponents
Returns a new instance of DeliveryWindowComponents.
17328 17329 17330 17331 17332 17333 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17328 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:shipment_estimate, :transit_estimate], 'DeliveryWindowComponents') @shipment_estimate = (x = opts.delete(:shipment_estimate); x.is_a?(::Io::Flow::V0::Models::DeliveryWindowComponent) ? x : ::Io::Flow::V0::Models::DeliveryWindowComponent.new(x)) @transit_estimate = (x = opts.delete(:transit_estimate); x.is_a?(::Io::Flow::V0::Models::DeliveryWindowComponent) ? x : ::Io::Flow::V0::Models::DeliveryWindowComponent.new(x)) end |
Instance Attribute Details
#shipment_estimate ⇒ Object (readonly)
Returns the value of attribute shipment_estimate.
17326 17327 17328 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17326 def shipment_estimate @shipment_estimate end |
#transit_estimate ⇒ Object (readonly)
Returns the value of attribute transit_estimate.
17326 17327 17328 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17326 def transit_estimate @transit_estimate end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
17339 17340 17341 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17339 def copy(incoming={}) DeliveryWindowComponents.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
17343 17344 17345 17346 17347 17348 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17343 def to_hash { :shipment_estimate => shipment_estimate.to_hash, :transit_estimate => transit_estimate.to_hash } end |
#to_json ⇒ Object
17335 17336 17337 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17335 def to_json JSON.dump(to_hash) end |