Class: Spree::FeedProduct
- Inherits:
-
Object
- Object
- Spree::FeedProduct
- Defined in:
- app/models/spree/feed_product.rb
Instance Attribute Summary collapse
-
#product ⇒ Object
readonly
Returns the value of attribute product.
Instance Method Summary collapse
-
#category ⇒ Object
Must be selected from support.google.com/merchants/answer/1705911.
-
#condition ⇒ Object
Must be “new”, “refurbished”, or “used”.
- #description ⇒ Object
- #id ⇒ Object
- #image_link ⇒ Object
-
#initialize(product) ⇒ FeedProduct
constructor
A new instance of FeedProduct.
- #price ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(product) ⇒ FeedProduct
Returns a new instance of FeedProduct.
5 6 7 |
# File 'app/models/spree/feed_product.rb', line 5 def initialize(product) @product = product end |
Instance Attribute Details
#product ⇒ Object (readonly)
Returns the value of attribute product.
3 4 5 |
# File 'app/models/spree/feed_product.rb', line 3 def product @product end |
Instance Method Details
#category ⇒ Object
Must be selected from support.google.com/merchants/answer/1705911
22 23 |
# File 'app/models/spree/feed_product.rb', line 22 def category end |
#condition ⇒ Object
Must be “new”, “refurbished”, or “used”.
26 27 28 |
# File 'app/models/spree/feed_product.rb', line 26 def condition "new" end |
#description ⇒ Object
17 18 19 |
# File 'app/models/spree/feed_product.rb', line 17 def description product.description end |
#id ⇒ Object
9 10 11 |
# File 'app/models/spree/feed_product.rb', line 9 def id product.id end |
#image_link ⇒ Object
34 35 36 37 |
# File 'app/models/spree/feed_product.rb', line 34 def image_link return unless product.images.any? product.images.first..url(:large) end |
#price ⇒ Object
30 31 32 |
# File 'app/models/spree/feed_product.rb', line 30 def price Spree::Money.new(product.price) end |
#title ⇒ Object
13 14 15 |
# File 'app/models/spree/feed_product.rb', line 13 def title product.name end |