Class: Peddler::Inventory::Item
- Inherits:
-
Object
- Object
- Peddler::Inventory::Item
- Defined in:
- lib/peddler/inventory.rb
Overview
This is an inventory item.
Instance Attribute Summary collapse
-
#add_delete ⇒ Object
Returns the value of attribute add_delete.
-
#asin1 ⇒ Object
Returns the value of attribute asin1.
-
#asin2 ⇒ Object
Returns the value of attribute asin2.
-
#asin3 ⇒ Object
Returns the value of attribute asin3.
-
#boldface ⇒ Object
Returns the value of attribute boldface.
-
#browse_path ⇒ Object
Returns the value of attribute browse_path.
-
#category1 ⇒ Object
Returns the value of attribute category1.
-
#expedited_shipping ⇒ Object
Returns the value of attribute expedited_shipping.
-
#fulfillment_center_id ⇒ Object
Returns the value of attribute fulfillment_center_id.
-
#image_url ⇒ Object
Returns the value of attribute image_url.
-
#item_condition ⇒ Object
Returns the value of attribute item_condition.
-
#item_description ⇒ Object
Returns the value of attribute item_description.
-
#item_is_marketplace ⇒ Object
Returns the value of attribute item_is_marketplace.
-
#item_name ⇒ Object
Returns the value of attribute item_name.
-
#item_note ⇒ Object
Returns the value of attribute item_note.
-
#price ⇒ Object
Returns the value of attribute price.
-
#product_id ⇒ Object
Returns the value of attribute product_id.
-
#product_id_type ⇒ Object
Returns the value of attribute product_id_type.
-
#quantity ⇒ Object
Returns the value of attribute quantity.
-
#shipping_fee ⇒ Object
Returns the value of attribute shipping_fee.
-
#sku ⇒ Object
Returns the value of attribute sku.
-
#storefront_feature ⇒ Object
Returns the value of attribute storefront_feature.
-
#will_ship_internationally ⇒ Object
Returns the value of attribute will_ship_internationally.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Item
constructor
A new instance of Item.
- #to_s(type = :long) ⇒ Object
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_delete ⇒ Object
Returns the value of attribute add_delete.
102 103 104 |
# File 'lib/peddler/inventory.rb', line 102 def add_delete @add_delete end |
#asin1 ⇒ Object
Returns the value of attribute asin1.
102 103 104 |
# File 'lib/peddler/inventory.rb', line 102 def asin1 @asin1 end |
#asin2 ⇒ Object
Returns the value of attribute asin2.
102 103 104 |
# File 'lib/peddler/inventory.rb', line 102 def asin2 @asin2 end |
#asin3 ⇒ Object
Returns the value of attribute asin3.
102 103 104 |
# File 'lib/peddler/inventory.rb', line 102 def asin3 @asin3 end |
#boldface ⇒ Object
Returns the value of attribute boldface.
102 103 104 |
# File 'lib/peddler/inventory.rb', line 102 def boldface @boldface end |
#browse_path ⇒ Object
Returns the value of attribute browse_path.
102 103 104 |
# File 'lib/peddler/inventory.rb', line 102 def browse_path @browse_path end |
#category1 ⇒ Object
Returns the value of attribute category1.
102 103 104 |
# File 'lib/peddler/inventory.rb', line 102 def category1 @category1 end |
#expedited_shipping ⇒ Object
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_id ⇒ Object
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_url ⇒ Object
Returns the value of attribute image_url.
102 103 104 |
# File 'lib/peddler/inventory.rb', line 102 def image_url @image_url end |
#item_condition ⇒ Object
Returns the value of attribute item_condition.
102 103 104 |
# File 'lib/peddler/inventory.rb', line 102 def item_condition @item_condition end |
#item_description ⇒ Object
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_marketplace ⇒ Object
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_name ⇒ Object
Returns the value of attribute item_name.
102 103 104 |
# File 'lib/peddler/inventory.rb', line 102 def item_name @item_name end |
#item_note ⇒ Object
Returns the value of attribute item_note.
102 103 104 |
# File 'lib/peddler/inventory.rb', line 102 def item_note @item_note end |
#price ⇒ Object
Returns the value of attribute price.
102 103 104 |
# File 'lib/peddler/inventory.rb', line 102 def price @price end |
#product_id ⇒ Object
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_type ⇒ Object
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 |
#quantity ⇒ Object
Returns the value of attribute quantity.
102 103 104 |
# File 'lib/peddler/inventory.rb', line 102 def quantity @quantity end |
#shipping_fee ⇒ Object
Returns the value of attribute shipping_fee.
102 103 104 |
# File 'lib/peddler/inventory.rb', line 102 def shipping_fee @shipping_fee end |
#sku ⇒ Object
Returns the value of attribute sku.
102 103 104 |
# File 'lib/peddler/inventory.rb', line 102 def sku @sku end |
#storefront_feature ⇒ Object
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_internationally ⇒ Object
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 |