Class: Io::Flow::V0::Models::ShopifyOrderDeliveryMetafield
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ShopifyOrderDeliveryMetafield
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Model to represent a delivery metafield
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
-
#window ⇒ Object
readonly
Returns the value of attribute window.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ShopifyOrderDeliveryMetafield
constructor
A new instance of ShopifyOrderDeliveryMetafield.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ShopifyOrderDeliveryMetafield
Returns a new instance of ShopifyOrderDeliveryMetafield.
38422 38423 38424 38425 38426 38427 38428 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38422 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:items, :service, :window], 'ShopifyOrderDeliveryMetafield') @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ShopifyOrderDeliveryMetafieldItem) ? x : ::Io::Flow::V0::Models::ShopifyOrderDeliveryMetafieldItem.new(x)) } @service = (x = opts.delete(:service); x.is_a?(::Io::Flow::V0::Models::ServiceSummary) ? x : ::Io::Flow::V0::Models::ServiceSummary.new(x)) @window = (x = opts.delete(:window); x.is_a?(::Io::Flow::V0::Models::DeliveryWindow) ? x : ::Io::Flow::V0::Models::DeliveryWindow.new(x)) end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
38420 38421 38422 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38420 def items @items end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
38420 38421 38422 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38420 def service @service end |
#window ⇒ Object (readonly)
Returns the value of attribute window.
38420 38421 38422 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38420 def window @window end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
38434 38435 38436 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38434 def copy(incoming={}) ShopifyOrderDeliveryMetafield.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
38438 38439 38440 38441 38442 38443 38444 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38438 def to_hash { :items => items.map { |o| o.to_hash }, :service => service.to_hash, :window => window.to_hash } end |
#to_json ⇒ Object
38430 38431 38432 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38430 def to_json JSON.dump(to_hash) end |