Sha256: d982a515177e5d15bb74b9aa992297b526638c22b441dbb4de3d18d2685b5e0b

Contents?: true

Size: 1.27 KB

Versions: 10

Compression:

Stored size: 1.27 KB

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/abstract_methods'

module Aranha
  class Manager
    include ::EacRubyUtils::AbstractMethods

    class << self
      attr_accessor :default
    end

    def addresses_count
      raise_abstract_method(__method__)
    end

    def add_address(_uri, _processor_class, _extra_data = nil)
      raise_abstract_method(__method__)
    end

    def add_start_point(uri, processor_class, extra_data = nil)
      start_points_var << ::EacRubyUtils::Struct.new(
        uri: uri, processor_class: processor_class, extra_data: extra_data
      )
    end

    def clear_expired_addresses
      raise_abstract_method(__method__)
    end

    def init
      clear_expired_addresses
      start_points_to_addresses
    end

    def log_info(_message)
      raise_abstract_method(__method__)
    end

    def log_warn(_message)
      raise_abstract_method(__method__)
    end

    def start_points
      start_points_var.to_enum
    end

    def start_points_to_addresses
      start_points_var.each do |sp|
        add_address(sp.uri, sp.processor_class, sp.extra_data)
      end
    end

    def unprocessed_addresses
      raise_abstract_method(__method__)
    end

    private

    def start_points_var
      @start_points_var ||= []
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
aranha-0.19.1 lib/aranha/manager.rb
aranha-0.19.0 lib/aranha/manager.rb
aranha-0.18.0 lib/aranha/manager.rb
aranha-0.17.1 lib/aranha/manager.rb
aranha-0.17.0 lib/aranha/manager.rb
aranha-0.16.1 lib/aranha/manager.rb
aranha-0.16.0 lib/aranha/manager.rb
aranha-0.15.2 lib/aranha/manager.rb
aranha-0.15.1 lib/aranha/manager.rb
aranha-0.15.0 lib/aranha/manager.rb