Class: Io::Flow::V0::Models::ShippingLaneSummary
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ShippingLaneSummary
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#centers ⇒ Object
readonly
Returns the value of attribute centers.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
-
#shipping_lane_id ⇒ Object
readonly
Returns the value of attribute shipping_lane_id.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ShippingLaneSummary
constructor
A new instance of ShippingLaneSummary.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ShippingLaneSummary
Returns a new instance of ShippingLaneSummary.
50264 50265 50266 50267 50268 50269 50270 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50264 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:shipping_lane_id, :region, :centers], 'ShippingLaneSummary') @shipping_lane_id = HttpClient::Preconditions.assert_class('shipping_lane_id', opts.delete(:shipping_lane_id), String) @region = HttpClient::Preconditions.assert_class('region', opts.delete(:region), String) @centers = HttpClient::Preconditions.assert_class('centers', opts.delete(:centers), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ExpandableCenter) ? x : ::Io::Flow::V0::Models::ExpandableCenter.from_json(x)) } end |
Instance Attribute Details
#centers ⇒ Object (readonly)
Returns the value of attribute centers.
50262 50263 50264 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50262 def centers @centers end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
50262 50263 50264 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50262 def region @region end |
#shipping_lane_id ⇒ Object (readonly)
Returns the value of attribute shipping_lane_id.
50262 50263 50264 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50262 def shipping_lane_id @shipping_lane_id end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
50276 50277 50278 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50276 def copy(incoming={}) ShippingLaneSummary.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
50280 50281 50282 50283 50284 50285 50286 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50280 def to_hash { :shipping_lane_id => shipping_lane_id, :region => region, :centers => centers.map { |o| o.to_hash } } end |
#to_json ⇒ Object
50272 50273 50274 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50272 def to_json JSON.dump(to_hash) end |