Class: Firecrawl::Models::ProductProfile::Variant
- Inherits:
-
Object
- Object
- Firecrawl::Models::ProductProfile::Variant
- Defined in:
- lib/firecrawl/models/product_profile.rb
Overview
A purchasable variant of a product. Pricing, availability, and images live here rather than on the top-level product.
Instance Attribute Summary collapse
-
#availability ⇒ Object
readonly
Returns the value of attribute availability.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#images ⇒ Object
readonly
Returns the value of attribute images.
-
#price ⇒ Object
readonly
Returns the value of attribute price.
-
#sale ⇒ Object
readonly
Returns the value of attribute sale.
-
#sku ⇒ Object
readonly
Returns the value of attribute sku.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
-
#initialize(data) ⇒ Variant
constructor
A new instance of Variant.
Constructor Details
#initialize(data) ⇒ Variant
Returns a new instance of Variant.
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/firecrawl/models/product_profile.rb', line 55 def initialize(data) @id = data["id"] @sku = data["sku"] @title = data["title"] @values = data["values"] @price = data["price"] && Price.new(data["price"]) @sale = data["sale"] && Sale.new(data["sale"]) @availability = Availability.new(data["availability"]) @images = (data["images"] || []).map { |img| Image.new(img) } end |
Instance Attribute Details
#availability ⇒ Object (readonly)
Returns the value of attribute availability.
52 53 54 |
# File 'lib/firecrawl/models/product_profile.rb', line 52 def availability @availability end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
52 53 54 |
# File 'lib/firecrawl/models/product_profile.rb', line 52 def id @id end |
#images ⇒ Object (readonly)
Returns the value of attribute images.
52 53 54 |
# File 'lib/firecrawl/models/product_profile.rb', line 52 def images @images end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
52 53 54 |
# File 'lib/firecrawl/models/product_profile.rb', line 52 def price @price end |
#sale ⇒ Object (readonly)
Returns the value of attribute sale.
52 53 54 |
# File 'lib/firecrawl/models/product_profile.rb', line 52 def sale @sale end |
#sku ⇒ Object (readonly)
Returns the value of attribute sku.
52 53 54 |
# File 'lib/firecrawl/models/product_profile.rb', line 52 def sku @sku end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
52 53 54 |
# File 'lib/firecrawl/models/product_profile.rb', line 52 def title @title end |
#values ⇒ Object (readonly)
Returns the value of attribute values.
52 53 54 |
# File 'lib/firecrawl/models/product_profile.rb', line 52 def values @values end |