Class: Io::Flow::V0::Models::FulfillmentItemQuantity
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::FulfillmentItemQuantity
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Fulfillment status of item quantities
Instance Attribute Summary collapse
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ FulfillmentItemQuantity
constructor
A new instance of FulfillmentItemQuantity.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ FulfillmentItemQuantity
Returns a new instance of FulfillmentItemQuantity.
44149 44150 44151 44152 44153 44154 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44149 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:status, :quantity], 'FulfillmentItemQuantity') @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::FulfillmentItemQuantityStatus) ? x : ::Io::Flow::V0::Models::FulfillmentItemQuantityStatus.apply(x)) @quantity = HttpClient::Preconditions.assert_class('quantity', opts.delete(:quantity), Integer) end |
Instance Attribute Details
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
44147 44148 44149 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44147 def quantity @quantity end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
44147 44148 44149 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44147 def status @status end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
44160 44161 44162 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44160 def copy(incoming={}) FulfillmentItemQuantity.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
44164 44165 44166 44167 44168 44169 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44164 def to_hash { :status => status.value, :quantity => quantity } end |
#to_json ⇒ Object
44156 44157 44158 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44156 def to_json JSON.dump(to_hash) end |