Module: Firecrawl::ModuleMethods
- Included in:
- Firecrawl
- Defined in:
- lib/firecrawl/module_methods.rb
Constant Summary collapse
- DEFAULT_CONNECTION =
Faraday.new { | builder | builder.adapter Faraday.default_adapter }
Instance Method Summary collapse
- #api_key(api_key = nil) ⇒ Object
- #connection(connection = nil) ⇒ Object
- #scrape(url, options = nil, &block) ⇒ Object
Instance Method Details
#api_key(api_key = nil) ⇒ Object
9 10 11 12 |
# File 'lib/firecrawl/module_methods.rb', line 9 def api_key( api_key = nil ) @api_key = api_key || @api_key @api_key end |
#connection(connection = nil) ⇒ Object
5 6 7 |
# File 'lib/firecrawl/module_methods.rb', line 5 def connection( connection = nil ) @connection = connection || @connection || DEFAULT_CONNECTION end |
#scrape(url, options = nil, &block) ⇒ Object
14 15 16 |
# File 'lib/firecrawl/module_methods.rb', line 14 def scrape( url, = nil, &block ) Firecrawl::ScrapeRequest.new.submit( url, , &block ) end |