Class: AmazonSellerCentral::Listing
- Inherits:
-
Object
- Object
- AmazonSellerCentral::Listing
- Extended by:
- ClassMethods
- Defined in:
- lib/amazon_seller_central/listing.rb
Overview
It turns out you can’t get low_price without executing a sub-request, so I’m leaving it alone for now.
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#asin ⇒ Object
Returns the value of attribute asin.
-
#condition ⇒ Object
Returns the value of attribute condition.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#low_price_cents ⇒ Object
Returns the value of attribute low_price_cents.
-
#price_cents ⇒ Object
Returns the value of attribute price_cents.
-
#product_name ⇒ Object
(also: #product)
Returns the value of attribute product_name.
-
#quantity ⇒ Object
(also: #qty)
Returns the value of attribute quantity.
-
#sku ⇒ Object
Returns the value of attribute sku.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
- #low_price ⇒ Object
- #low_price=(low_price) ⇒ Object
- #price ⇒ Object (also: #your_price)
- #price=(price) ⇒ Object (also: #your_price=)
- #save ⇒ Object
Methods included from ClassMethods
Instance Attribute Details
#asin ⇒ Object
Returns the value of attribute asin.
12 13 14 |
# File 'lib/amazon_seller_central/listing.rb', line 12 def asin @asin end |
#condition ⇒ Object
Returns the value of attribute condition.
12 13 14 |
# File 'lib/amazon_seller_central/listing.rb', line 12 def condition @condition end |
#created_at ⇒ Object
Returns the value of attribute created_at.
12 13 14 |
# File 'lib/amazon_seller_central/listing.rb', line 12 def created_at @created_at end |
#low_price_cents ⇒ Object
Returns the value of attribute low_price_cents.
12 13 14 |
# File 'lib/amazon_seller_central/listing.rb', line 12 def low_price_cents @low_price_cents end |
#price_cents ⇒ Object
Returns the value of attribute price_cents.
12 13 14 |
# File 'lib/amazon_seller_central/listing.rb', line 12 def price_cents @price_cents end |
#product_name ⇒ Object Also known as: product
Returns the value of attribute product_name.
12 13 14 |
# File 'lib/amazon_seller_central/listing.rb', line 12 def product_name @product_name end |
#quantity ⇒ Object Also known as: qty
Returns the value of attribute quantity.
12 13 14 |
# File 'lib/amazon_seller_central/listing.rb', line 12 def quantity @quantity end |
#sku ⇒ Object
Returns the value of attribute sku.
12 13 14 |
# File 'lib/amazon_seller_central/listing.rb', line 12 def sku @sku end |
#status ⇒ Object
Returns the value of attribute status.
12 13 14 |
# File 'lib/amazon_seller_central/listing.rb', line 12 def status @status end |
Instance Method Details
#low_price ⇒ Object
30 31 32 |
# File 'lib/amazon_seller_central/listing.rb', line 30 def low_price @low_price_cents.kind_of?(Numeric) ? @low_price_cents / 100.0 : @low_price_cents end |
#low_price=(low_price) ⇒ Object
33 34 35 |
# File 'lib/amazon_seller_central/listing.rb', line 33 def low_price=(low_price) @low_price_cents = low_price.kind_of?(Numeric) ? (low_price * 100).round : low_price end |
#price ⇒ Object Also known as: your_price
20 21 22 |
# File 'lib/amazon_seller_central/listing.rb', line 20 def price @price_cents.kind_of?(Numeric) ? @price_cents / 100.0 : @price_cents end |
#price=(price) ⇒ Object Also known as: your_price=
23 24 25 |
# File 'lib/amazon_seller_central/listing.rb', line 23 def price=(price) @price_cents = price.kind_of?(Numeric) ? (price * 100).round : price end |
#save ⇒ Object
37 38 39 40 |
# File 'lib/amazon_seller_central/listing.rb', line 37 def save puts "Sorry, you want to send this listing as part of an array to the InventoryPage it came from, with InventoryPage#apply_listings" false end |