Method: JustCrawl::Engine#initialize

Defined in:
lib/just_crawl/engine.rb

#initialize(caller_options = {}) ⇒ Engine

Returns a new instance of Engine.



20
21
22
23
24
25
26
27
28
# File 'lib/just_crawl/engine.rb', line 20

def initialize(caller_options = {})
  @options = DEFAULT_OPTIONS.merge(caller_options)
  @authorization = Base64.encode64("#{options[:username]}:#{options[:password]}")
  @register = JustCrawl::Register.new

  start_pages = options[:start].to_a.map { |page| Page.new(@register, page, '/') }

  @register.add(start_pages)
end