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
-
#item_number ⇒ Object
readonly
Returns the value of attribute item_number.
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
-
#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.
35727 35728 35729 35730 35731 35732 35733 35734 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35727 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:item_number, :quantity, :service, :window], 'ShopifyOrderDeliveryMetafield') @item_number = HttpClient::Preconditions.assert_class('item_number', opts.delete(:item_number), String) @quantity = HttpClient::Preconditions.assert_class('quantity', opts.delete(:quantity), Integer) @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
#item_number ⇒ Object (readonly)
Returns the value of attribute item_number.
35725 35726 35727 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35725 def item_number @item_number end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
35725 35726 35727 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35725 def quantity @quantity end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
35725 35726 35727 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35725 def service @service end |
#window ⇒ Object (readonly)
Returns the value of attribute window.
35725 35726 35727 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35725 def window @window end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
35740 35741 35742 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35740 def copy(incoming={}) ShopifyOrderDeliveryMetafield.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
35744 35745 35746 35747 35748 35749 35750 35751 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35744 def to_hash { :item_number => item_number, :quantity => quantity, :service => service.to_hash, :window => window.to_hash } end |
#to_json ⇒ Object
35736 35737 35738 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35736 def to_json JSON.dump(to_hash) end |