Class: Firecrawl::Models::SearchData
- Inherits:
-
Object
- Object
- Firecrawl::Models::SearchData
- Defined in:
- lib/firecrawl/models/search_data.rb
Overview
Search results from the v2 search API.
Instance Attribute Summary collapse
-
#images ⇒ Object
readonly
Returns the value of attribute images.
-
#news ⇒ Object
readonly
Returns the value of attribute news.
-
#web ⇒ Object
readonly
Returns the value of attribute web.
Instance Method Summary collapse
-
#initialize(data) ⇒ SearchData
constructor
A new instance of SearchData.
- #to_s ⇒ Object
Constructor Details
#initialize(data) ⇒ SearchData
Returns a new instance of SearchData.
9 10 11 12 13 |
# File 'lib/firecrawl/models/search_data.rb', line 9 def initialize(data) @web = data["web"] @news = data["news"] @images = data["images"] end |
Instance Attribute Details
#images ⇒ Object (readonly)
Returns the value of attribute images.
7 8 9 |
# File 'lib/firecrawl/models/search_data.rb', line 7 def images @images end |
#news ⇒ Object (readonly)
Returns the value of attribute news.
7 8 9 |
# File 'lib/firecrawl/models/search_data.rb', line 7 def news @news end |
#web ⇒ Object (readonly)
Returns the value of attribute web.
7 8 9 |
# File 'lib/firecrawl/models/search_data.rb', line 7 def web @web end |
Instance Method Details
#to_s ⇒ Object
15 16 17 18 19 20 |
# File 'lib/firecrawl/models/search_data.rb', line 15 def to_s web_count = web&.size || 0 news_count = news&.size || 0 image_count = images&.size || 0 "SearchData{web=#{web_count}, news=#{news_count}, images=#{image_count}}" end |