Class: Firecrawl::Models::Document
- Inherits:
-
Object
- Object
- Firecrawl::Models::Document
- Defined in:
- lib/firecrawl/models/document.rb
Overview
A scraped document returned by scrape, crawl, and batch endpoints.
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#audio ⇒ Object
readonly
Returns the value of attribute audio.
-
#branding ⇒ Object
readonly
Returns the value of attribute branding.
-
#change_tracking ⇒ Object
readonly
Returns the value of attribute change_tracking.
-
#html ⇒ Object
readonly
Returns the value of attribute html.
-
#images ⇒ Object
readonly
Returns the value of attribute images.
-
#json ⇒ Object
readonly
Returns the value of attribute json.
-
#links ⇒ Object
readonly
Returns the value of attribute links.
-
#markdown ⇒ Object
readonly
Returns the value of attribute markdown.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#raw_html ⇒ Object
readonly
Returns the value of attribute raw_html.
-
#screenshot ⇒ Object
readonly
Returns the value of attribute screenshot.
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
-
#warning ⇒ Object
readonly
Returns the value of attribute warning.
Instance Method Summary collapse
-
#initialize(data) ⇒ Document
constructor
A new instance of Document.
- #to_s ⇒ Object
Constructor Details
#initialize(data) ⇒ Document
Returns a new instance of Document.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/firecrawl/models/document.rb', line 11 def initialize(data) @markdown = data["markdown"] @html = data["html"] @raw_html = data["rawHtml"] @json = data["json"] @summary = data["summary"] @metadata = data["metadata"] @links = data["links"] @images = data["images"] @screenshot = data["screenshot"] @audio = data["audio"] @attributes = data["attributes"] @actions = data["actions"] @warning = data["warning"] @change_tracking = data["changeTracking"] @branding = data["branding"] end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
7 8 9 |
# File 'lib/firecrawl/models/document.rb', line 7 def actions @actions end |
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
7 8 9 |
# File 'lib/firecrawl/models/document.rb', line 7 def attributes @attributes end |
#audio ⇒ Object (readonly)
Returns the value of attribute audio.
7 8 9 |
# File 'lib/firecrawl/models/document.rb', line 7 def audio @audio end |
#branding ⇒ Object (readonly)
Returns the value of attribute branding.
7 8 9 |
# File 'lib/firecrawl/models/document.rb', line 7 def branding @branding end |
#change_tracking ⇒ Object (readonly)
Returns the value of attribute change_tracking.
7 8 9 |
# File 'lib/firecrawl/models/document.rb', line 7 def change_tracking @change_tracking end |
#html ⇒ Object (readonly)
Returns the value of attribute html.
7 8 9 |
# File 'lib/firecrawl/models/document.rb', line 7 def html @html end |
#images ⇒ Object (readonly)
Returns the value of attribute images.
7 8 9 |
# File 'lib/firecrawl/models/document.rb', line 7 def images @images end |
#json ⇒ Object (readonly)
Returns the value of attribute json.
7 8 9 |
# File 'lib/firecrawl/models/document.rb', line 7 def json @json end |
#links ⇒ Object (readonly)
Returns the value of attribute links.
7 8 9 |
# File 'lib/firecrawl/models/document.rb', line 7 def links @links end |
#markdown ⇒ Object (readonly)
Returns the value of attribute markdown.
7 8 9 |
# File 'lib/firecrawl/models/document.rb', line 7 def markdown @markdown end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
7 8 9 |
# File 'lib/firecrawl/models/document.rb', line 7 def @metadata end |
#raw_html ⇒ Object (readonly)
Returns the value of attribute raw_html.
7 8 9 |
# File 'lib/firecrawl/models/document.rb', line 7 def raw_html @raw_html end |
#screenshot ⇒ Object (readonly)
Returns the value of attribute screenshot.
7 8 9 |
# File 'lib/firecrawl/models/document.rb', line 7 def screenshot @screenshot end |
#summary ⇒ Object (readonly)
Returns the value of attribute summary.
7 8 9 |
# File 'lib/firecrawl/models/document.rb', line 7 def summary @summary end |
#warning ⇒ Object (readonly)
Returns the value of attribute warning.
7 8 9 |
# File 'lib/firecrawl/models/document.rb', line 7 def warning @warning end |
Instance Method Details
#to_s ⇒ Object
29 30 31 32 33 |
# File 'lib/firecrawl/models/document.rb', line 29 def to_s title = &.dig("title") || "untitled" url = &.dig("sourceURL") || "unknown" "Document{title=#{title}, url=#{url}}" end |