Class: LinkChecker::Typhoeus::Hydra::Checker

Inherits:
Checker
  • Object
show all
Extended by:
Config
Defined in:
lib/ruby-link-checker/typhoeus/hydra/checker.rb

Constant Summary

Constants included from Config

LinkChecker::Typhoeus::Hydra::Config::ATTRIBUTES

Constants included from Config

Config::ATTRIBUTES

Instance Attribute Summary

Attributes inherited from Checker

#results

Instance Method Summary collapse

Methods included from Config

reset

Methods inherited from Checker

#check, #task_klass

Methods included from Callbacks

#callbacks, #delegates, #method_missing, #on

Methods included from Config

#reset, #retries=

Constructor Details

#initialize(options = {}) ⇒ Checker

Returns a new instance of Checker.



32
33
34
35
36
37
38
# File 'lib/ruby-link-checker/typhoeus/hydra/checker.rb', line 32

def initialize(options = {})
  LinkChecker::Typhoeus::Hydra::Config::ATTRIBUTES.each do |key|
    send("#{key}=", options[key] || LinkChecker::Typhoeus::Hydra::Config.send(key))
  end
  @hydra = ::Typhoeus::Hydra.new(options[:hydra] || { max_concurrency: 10 })
  super options
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class LinkChecker::Callbacks

Instance Method Details

#_queue(request) ⇒ Object



44
45
46
# File 'lib/ruby-link-checker/typhoeus/hydra/checker.rb', line 44

def _queue(request)
  @hydra.queue(request)
end

#runObject



40
41
42
# File 'lib/ruby-link-checker/typhoeus/hydra/checker.rb', line 40

def run
  @hydra.run
end