Module: LinkChecker::Config

Extended by:
Config
Included in:
Checker, Config
Defined in:
lib/ruby-link-checker/config.rb

Constant Summary collapse

ATTRIBUTES =
%i[
  methods
  user_agent
  logger
  retries
].freeze

Instance Method Summary collapse

Instance Method Details

#resetObject



16
17
18
19
20
21
# File 'lib/ruby-link-checker/config.rb', line 16

def reset
  self.methods = %w[HEAD GET]
  self.user_agent = "Ruby Link Checker/#{LinkChecker::VERSION}"
  self.logger = nil
  self.retries = 0
end

#retries=(value) ⇒ Object

Raises:

  • (ArgumentError)


23
24
25
26
27
# File 'lib/ruby-link-checker/config.rb', line 23

def retries=(value)
  raise ArgumentError, "Invalid number of retries: #{value}" unless value.is_a?(Integer) && value >= 0

  @retries = value
end