class Io::Flow::V0::Models::InventoryStock

Treats inventory as available as long as the actual inventory quantity is > the specified quantity. A common use case is to set quantity to zero to indicate availability as long as there is at least 1 unit available.

Attributes

quantity[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 46468
def initialize(incoming={})
  super(:discriminator => InventoryStrategy::Types::INVENTORY_STOCK)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:quantity], 'InventoryStock')
  @quantity = HttpClient::Preconditions.assert_class('quantity', opts.delete(:quantity), Integer)
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 46479
def copy(incoming={})
  InventoryStock.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
subtype_to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 46483
def subtype_to_hash
  {
    :quantity => quantity
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 46475
def to_json
  JSON.dump(to_hash)
end