Class: Peddler::Inventory::Item

Inherits:
Object
  • Object
show all
Defined in:
lib/peddler/inventory.rb

Overview

This is an inventory item.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Item

Returns a new instance of Item.



126
127
128
# File 'lib/peddler/inventory.rb', line 126

def initialize(params={})
  params.each_pair{ |key, value| send("#{key.to_s}=", value) }
end

Instance Attribute Details

#add_deleteObject

Returns the value of attribute add_delete.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def add_delete
  @add_delete
end

#asin1Object

Returns the value of attribute asin1.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def asin1
  @asin1
end

#asin2Object

Returns the value of attribute asin2.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def asin2
  @asin2
end

#asin3Object

Returns the value of attribute asin3.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def asin3
  @asin3
end

#boldfaceObject

Returns the value of attribute boldface.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def boldface
  @boldface
end

#browse_pathObject

Returns the value of attribute browse_path.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def browse_path
  @browse_path
end

#category1Object

Returns the value of attribute category1.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def category1
  @category1
end

#expedited_shippingObject

Returns the value of attribute expedited_shipping.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def expedited_shipping
  @expedited_shipping
end

#fulfillment_center_idObject

Returns the value of attribute fulfillment_center_id.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def fulfillment_center_id
  @fulfillment_center_id
end

#image_urlObject

Returns the value of attribute image_url.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def image_url
  @image_url
end

#item_conditionObject

Returns the value of attribute item_condition.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def item_condition
  @item_condition
end

#item_descriptionObject

Returns the value of attribute item_description.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def item_description
  @item_description
end

#item_is_marketplaceObject

Returns the value of attribute item_is_marketplace.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def item_is_marketplace
  @item_is_marketplace
end

#item_nameObject

Returns the value of attribute item_name.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def item_name
  @item_name
end

#item_noteObject

Returns the value of attribute item_note.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def item_note
  @item_note
end

#priceObject

Returns the value of attribute price.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def price
  @price
end

#product_idObject

Returns the value of attribute product_id.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def product_id
  @product_id
end

#product_id_typeObject

Returns the value of attribute product_id_type.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def product_id_type
  @product_id_type
end

#quantityObject

Returns the value of attribute quantity.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def quantity
  @quantity
end

#shipping_feeObject

Returns the value of attribute shipping_fee.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def shipping_fee
  @shipping_fee
end

#skuObject

Returns the value of attribute sku.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def sku
  @sku
end

#storefront_featureObject

Returns the value of attribute storefront_feature.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def storefront_feature
  @storefront_feature
end

#will_ship_internationallyObject

Returns the value of attribute will_ship_internationally.



102
103
104
# File 'lib/peddler/inventory.rb', line 102

def will_ship_internationally
  @will_ship_internationally
end

Instance Method Details

#to_s(type = :long) ⇒ Object



130
131
132
133
134
135
136
137
# File 'lib/peddler/inventory.rb', line 130

def to_s(type=:long)
  case type
  when :long
    "#{self.product_id}\t#{self.product_id_type}\t#{self.item_condition}\t#{self.price}\t#{self.sku}\t#{self.quantity}\t#{self.add_delete}\t#{self.will_ship_internationally}\t#{self.expedited_shipping}\t#{self.item_note}\t#{self.item_is_marketplace}\t#{self.fulfillment_center_id}\t#{self.item_name}\t#{self.item_description}\t#{self.category1}\t#{self.image_url}\t#{self.shipping_fee}\t#{self.browse_path}\t#{self.storefront_feature}\t#{self.boldface}\t#{self.asin1}\t#{self.asin2}\t#{self.asin3}\r\n"
  when :short
    "#{self.sku}\t#{self.price}\t#{self.quantity}\r\n"
  end
end