Class: Firecrawl::Models::ProductProfile
- Inherits:
-
Object
- Object
- Firecrawl::Models::ProductProfile
- Defined in:
- lib/firecrawl/models/product_profile.rb
Overview
Structured product information extracted from a product page via the ‘product` scrape format.
Defined Under Namespace
Classes: Availability, Image, Price, Sale, Variant
Instance Attribute Summary collapse
-
#brand ⇒ Object
readonly
Returns the value of attribute brand.
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#variants ⇒ Object
readonly
Returns the value of attribute variants.
Instance Method Summary collapse
-
#initialize(data) ⇒ ProductProfile
constructor
A new instance of ProductProfile.
- #to_s ⇒ Object
Constructor Details
#initialize(data) ⇒ ProductProfile
Returns a new instance of ProductProfile.
69 70 71 72 73 74 75 76 |
# File 'lib/firecrawl/models/product_profile.rb', line 69 def initialize(data) @title = data["title"] @brand = data["brand"] @category = data["category"] @url = data["url"] @description = data["description"] @variants = (data["variants"] || []).map { |variant| Variant.new(variant) } end |
Instance Attribute Details
#brand ⇒ Object (readonly)
Returns the value of attribute brand.
67 68 69 |
# File 'lib/firecrawl/models/product_profile.rb', line 67 def brand @brand end |
#category ⇒ Object (readonly)
Returns the value of attribute category.
67 68 69 |
# File 'lib/firecrawl/models/product_profile.rb', line 67 def category @category end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
67 68 69 |
# File 'lib/firecrawl/models/product_profile.rb', line 67 def description @description end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
67 68 69 |
# File 'lib/firecrawl/models/product_profile.rb', line 67 def title @title end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
67 68 69 |
# File 'lib/firecrawl/models/product_profile.rb', line 67 def url @url end |
#variants ⇒ Object (readonly)
Returns the value of attribute variants.
67 68 69 |
# File 'lib/firecrawl/models/product_profile.rb', line 67 def variants @variants end |
Instance Method Details
#to_s ⇒ Object
78 79 80 |
# File 'lib/firecrawl/models/product_profile.rb', line 78 def to_s "ProductProfile{title=#{title || 'untitled'}, url=#{url || 'unknown'}}" end |