Class: Firecrawl::Models::MonitorTarget
- Inherits:
-
Object
- Object
- Firecrawl::Models::MonitorTarget
- Defined in:
- lib/firecrawl/models/monitor.rb
Overview
A scrape, crawl, or search target stored on a monitor.
Targets are forwarded to the API verbatim, so callers may also pass plain Hashes with camelCase keys. This class is a convenience for building well-formed target payloads (and is what #to_h emits).
Search targets (+type: "search"+) use the queries, search_window,
include_domains, exclude_domains, and max_results fields.
Instance Attribute Summary collapse
-
#crawl_options ⇒ Object
readonly
Returns the value of attribute crawl_options.
-
#exclude_domains ⇒ Object
readonly
Returns the value of attribute exclude_domains.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#include_domains ⇒ Object
readonly
Returns the value of attribute include_domains.
-
#max_results ⇒ Object
readonly
Returns the value of attribute max_results.
-
#queries ⇒ Object
readonly
Returns the value of attribute queries.
-
#scrape_options ⇒ Object
readonly
Returns the value of attribute scrape_options.
-
#search_window ⇒ Object
readonly
Returns the value of attribute search_window.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#urls ⇒ Object
readonly
Returns the value of attribute urls.
Instance Method Summary collapse
-
#initialize(data) ⇒ MonitorTarget
constructor
A new instance of MonitorTarget.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ MonitorTarget
Returns a new instance of MonitorTarget.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/firecrawl/models/monitor.rb', line 18 def initialize(data) @id = data["id"] @type = data["type"] @urls = data["urls"] @url = data["url"] @scrape_options = data["scrapeOptions"] @crawl_options = data["crawlOptions"] # search target fields @queries = data["queries"] @search_window = data["searchWindow"] @include_domains = data["includeDomains"] @exclude_domains = data["excludeDomains"] @max_results = data["maxResults"] end |
Instance Attribute Details
#crawl_options ⇒ Object (readonly)
Returns the value of attribute crawl_options.
14 15 16 |
# File 'lib/firecrawl/models/monitor.rb', line 14 def @crawl_options end |
#exclude_domains ⇒ Object (readonly)
Returns the value of attribute exclude_domains.
14 15 16 |
# File 'lib/firecrawl/models/monitor.rb', line 14 def exclude_domains @exclude_domains end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
14 15 16 |
# File 'lib/firecrawl/models/monitor.rb', line 14 def id @id end |
#include_domains ⇒ Object (readonly)
Returns the value of attribute include_domains.
14 15 16 |
# File 'lib/firecrawl/models/monitor.rb', line 14 def include_domains @include_domains end |
#max_results ⇒ Object (readonly)
Returns the value of attribute max_results.
14 15 16 |
# File 'lib/firecrawl/models/monitor.rb', line 14 def max_results @max_results end |
#queries ⇒ Object (readonly)
Returns the value of attribute queries.
14 15 16 |
# File 'lib/firecrawl/models/monitor.rb', line 14 def queries @queries end |
#scrape_options ⇒ Object (readonly)
Returns the value of attribute scrape_options.
14 15 16 |
# File 'lib/firecrawl/models/monitor.rb', line 14 def @scrape_options end |
#search_window ⇒ Object (readonly)
Returns the value of attribute search_window.
14 15 16 |
# File 'lib/firecrawl/models/monitor.rb', line 14 def search_window @search_window end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
14 15 16 |
# File 'lib/firecrawl/models/monitor.rb', line 14 def type @type end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
14 15 16 |
# File 'lib/firecrawl/models/monitor.rb', line 14 def url @url end |
#urls ⇒ Object (readonly)
Returns the value of attribute urls.
14 15 16 |
# File 'lib/firecrawl/models/monitor.rb', line 14 def urls @urls end |
Instance Method Details
#to_h ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/firecrawl/models/monitor.rb', line 33 def to_h { "id" => @id, "type" => @type, "urls" => @urls, "url" => @url, "scrapeOptions" => @scrape_options, "crawlOptions" => @crawl_options, "queries" => @queries, "searchWindow" => @search_window, "includeDomains" => @include_domains, "excludeDomains" => @exclude_domains, "maxResults" => @max_results, }.compact end |