require 'typhoeus'

module Metrics

  class LinkChecker < Metric
    attr_reader :score

    def initialize(metadata, worker=nil)
      @worker = worker
      @total = metadata.length
      @resource_availability = Hash.new
      metadata.each_with_index do |dataset, i|
        dataset[:resources].each do |resource|
          @resources += 1
          url = resource[:url]
          enqueue_request(url)
        end
        @worker.at(i + i, @total)
      end
    end

  end

end

Create Link Checker metric class with initializer
Create Link Checker metric class with initializer

Similar to the Accuracy metric I have added code for the Link Checker
metric initializer.

Signed-off-by: Konrad Reiche <4ff0213f56e2082fcd8c882d04c546881c579ce4@gmail.com>
