Class: Legitbot::Ahrefs

Inherits:
BotMatch show all
Defined in:
lib/legitbot/ahrefs.rb

Overview

Constant Summary collapse

Ranges =
%w(54.36.148.0/24 54.36.149.0/24 54.36.150.0/24 195.154.122.0/24 195.154.123.0/24 195.154.126.0/24 195.154.127.0/24)

Instance Method Summary collapse

Methods inherited from BotMatch

#detected_as, #fake?, fake?, #initialize, #reverse_domain, #reverse_name, #reverse_resolves?, #reversed_ip, #subdomain_of?, valid?

Constructor Details

This class inherits a constructor from Legitbot::BotMatch

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


6
7
8
9
# File 'lib/legitbot/ahrefs.rb', line 6

def valid?
  ip = IPAddr.new @ip
  Ranges.any? { |range| IPAddr.new(range).include? ip }
end