Class: Firecrawl::CrawlOptions

Inherits:
Object
  • Object
show all
Includes:
DynamicSchema::Definable, Helpers
Defined in:
lib/firecrawl/crawl_options.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#string_camelize

Constructor Details

#initialize(options = nil, api_options: nil) ⇒ CrawlOptions

Returns a new instance of CrawlOptions.



37
38
39
40
# File 'lib/firecrawl/crawl_options.rb', line 37

def initialize( options = nil, api_options: nil )
  @options = self.class.builder.build( options || {} )
  @options = api_options.merge( @options ) if api_options 
end

Class Method Details

.build(options = nil, &block) ⇒ Object



29
30
31
# File 'lib/firecrawl/crawl_options.rb', line 29

def self.build( options = nil, &block )
  new( api_options: builder.build( options, &block ) )
end

.build!(options = nil, &block) ⇒ Object



33
34
35
# File 'lib/firecrawl/crawl_options.rb', line 33

def self.build!( options = nil, &block )
  new( api_options: builder.build!( options, &block ) )
end

Instance Method Details

#to_hObject



42
43
44
# File 'lib/firecrawl/crawl_options.rb', line 42

def to_h
  @options.to_h 
end