Class: Firecrawl::Models::SearchData

Inherits:
Object
  • Object
show all
Defined in:
lib/firecrawl/models/search_data.rb

Overview

Search results from the v2 search API.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#imagesObject (readonly)

Returns the value of attribute images.



7
8
9
# File 'lib/firecrawl/models/search_data.rb', line 7

def images
  @images
end

#newsObject (readonly)

Returns the value of attribute news.



7
8
9
# File 'lib/firecrawl/models/search_data.rb', line 7

def news
  @news
end

#webObject (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_sObject



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