Method: Arwen#initialize

Defined in:
lib/arwen.rb

#initialize(url, opts = {}) ⇒ Arwen

Create a new Arwen instance

Parameters:

  • url (string)

    the full URL to the sitemap or sitemap_index XML file

  • opts (hash) (defaults to: {})

    options passed to Typheous::Request instances.

Options Hash (opts):

  • :max_concurrency (integer)

    maximum concurrent requests passed to Typheous::Hydra

See Also:



22
23
24
25
26
27
# File 'lib/arwen.rb', line 22

def initialize(url, opts = {})
  @url = url
  max_concurrency = opts.delete(:max_concurrency) { 200 }
  @opts = { followlocation: true }.merge(opts)
  @hydra = Typhoeus::Hydra.new(max_concurrency: max_concurrency)
end