Class: Mws::Apis::Feeds::Inventory
- Inherits:
-
Object
- Object
- Mws::Apis::Feeds::Inventory
- Defined in:
- lib/mws/apis/feeds/inventory.rb
Defined Under Namespace
Classes: Fulfillment
Instance Attribute Summary collapse
-
#available ⇒ Object
readonly
Returns the value of attribute available.
-
#fulfillment ⇒ Object
readonly
Returns the value of attribute fulfillment.
-
#lookup ⇒ Object
readonly
Returns the value of attribute lookup.
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
-
#restock ⇒ Object
readonly
Returns the value of attribute restock.
-
#sku ⇒ Object
readonly
Returns the value of attribute sku.
Instance Method Summary collapse
-
#initialize(sku, options) ⇒ Inventory
constructor
A new instance of Inventory.
- #to_xml(name = 'Inventory', parent = nil) ⇒ Object
Constructor Details
#initialize(sku, options) ⇒ Inventory
Returns a new instance of Inventory.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/mws/apis/feeds/inventory.rb', line 7 def initialize(sku, ) @sku = sku @available = [:available] @quantity = [:quantity] @lookup = [:lookup] @fulfillment = Fulfillment.new( [:fulfillment_center], [:fulfillment_latency], [:fulfillment_type] ) @restock = [:restock] validate end |
Instance Attribute Details
#available ⇒ Object (readonly)
Returns the value of attribute available.
5 6 7 |
# File 'lib/mws/apis/feeds/inventory.rb', line 5 def available @available end |
#fulfillment ⇒ Object (readonly)
Returns the value of attribute fulfillment.
5 6 7 |
# File 'lib/mws/apis/feeds/inventory.rb', line 5 def fulfillment @fulfillment end |
#lookup ⇒ Object (readonly)
Returns the value of attribute lookup.
5 6 7 |
# File 'lib/mws/apis/feeds/inventory.rb', line 5 def lookup @lookup end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
5 6 7 |
# File 'lib/mws/apis/feeds/inventory.rb', line 5 def quantity @quantity end |
#restock ⇒ Object (readonly)
Returns the value of attribute restock.
5 6 7 |
# File 'lib/mws/apis/feeds/inventory.rb', line 5 def restock @restock end |
#sku ⇒ Object (readonly)
Returns the value of attribute sku.
5 6 7 |
# File 'lib/mws/apis/feeds/inventory.rb', line 5 def sku @sku end |
Instance Method Details
#to_xml(name = 'Inventory', parent = nil) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/mws/apis/feeds/inventory.rb', line 21 def to_xml(name='Inventory', parent=nil) Mws::Serializer.tree name, parent do |xml| xml.SKU @sku xml.FulfillmentCenterID @fulfillment.center unless @fulfillment.center.nil? xml.Available @available unless @available.nil? xml.Quantity @quantity unless @quantity.nil? xml.Lookup @lookup unless @lookup.nil? xml.RestockDate @restock.iso8601 unless @restock.nil? xml.FulfillmentLatency @fulfillment.latency unless @fulfillment.latency.nil? xml.SwitchFulfillmentTo Fulfillment::Type.for(@fulfillment.type).val unless @fulfillment.type.nil? end end |