Class: Afterpay::Components::Item

Inherits:
Base
  • Object
show all
Defined in:
lib/afterpay/components/item.rb

Instance Attribute Summary collapse

Method Summary

Methods included from Initializable

included, #initialize

Methods included from Representable

#as_json, included

Instance Attribute Details

#categoriesArray

An array of arrays to accommodate multiple categories that apply to the item. Each array represents a hierarchical path to a category, with the left-most category being the top-level parent category.

Returns:

  • (Array)


40
41
42
# File 'lib/afterpay/components/item.rb', line 40

def categories
  @categories
end

#estimated_shipment_dateString

The estimated date when the order will be shipped, in YYYY-MM or YYYY-MM-DD format

Returns:

  • (String)


45
46
47
# File 'lib/afterpay/components/item.rb', line 45

def estimated_shipment_date
  @estimated_shipment_date
end

#image_urlString

A URL for a web-optimised photo of the item, suitable for use directly as the src attribute of an img tag. Limited to 2048 characters.

Returns:

  • (String)


24
25
26
# File 'lib/afterpay/components/item.rb', line 24

def image_url
  @image_url
end

#nameString

Product’s name

Returns:

  • (String)


9
10
11
# File 'lib/afterpay/components/item.rb', line 9

def name
  @name
end

#page_urlString

The canonical URL for the item’s Product Detail Page. Limited to 2048 characters.

Returns:

  • (String)


19
20
21
# File 'lib/afterpay/components/item.rb', line 19

def page_url
  @page_url
end

#preorderObject

Should return false when the estimated_shipment_date is already passed otherwise true

Returns:

  • boolean



50
51
52
# File 'lib/afterpay/components/item.rb', line 50

def preorder
  @preorder
end

#priceAfterpay::Components::Money

The unit price of the individual item. Must be a positive value.



34
35
36
# File 'lib/afterpay/components/item.rb', line 34

def price
  @price
end

#quantityInteger

The quantity of the item.

Returns:

  • (Integer)


29
30
31
# File 'lib/afterpay/components/item.rb', line 29

def quantity
  @quantity
end

#skuString

Product’s SKU

Returns:

  • (String)


14
15
16
# File 'lib/afterpay/components/item.rb', line 14

def sku
  @sku
end