Class: AmazonSellerCentral::Listing

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Methods included from ClassMethods

is_asin?

Instance Attribute Details

#asinObject

Returns the value of attribute asin.



12
13
14
# File 'lib/amazon_seller_central/listing.rb', line 12

def asin
  @asin
end

#conditionObject

Returns the value of attribute condition.



12
13
14
# File 'lib/amazon_seller_central/listing.rb', line 12

def condition
  @condition
end

#created_atObject

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_centsObject

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_centsObject

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_nameObject 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

#quantityObject 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

#skuObject

Returns the value of attribute sku.



12
13
14
# File 'lib/amazon_seller_central/listing.rb', line 12

def sku
  @sku
end

#statusObject

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_priceObject



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

#priceObject 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

#saveObject



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