Class: Legitbot::BotMatch
Overview
Represents a bot instance match. Typical methods are valid?
, fake?
and detected_as
Direct Known Subclasses
Ahrefs, Amazon, Apple, BLEXBot, Baidu, Bing, DataForSEO, DuckDuckGo, Facebook, GPTBot, Google, Ias, Marginalia, Meta, OpenAIChat, OpenAISearch, Oracle, Petalbot, Pinterest, Twitter, Yandex, You
Class Method Summary
collapse
Instance Method Summary
collapse
included, #valid_domain?
included, #valid_ip?
Constructor Details
#initialize(ip) ⇒ BotMatch
Returns a new instance of BotMatch.
16
17
18
|
# File 'lib/legitbot/botmatch.rb', line 16
def initialize(ip)
@ip = ip
end
|
Class Method Details
.fake?(ip) ⇒ Boolean
36
37
38
|
# File 'lib/legitbot/botmatch.rb', line 36
def self.fake?(ip)
new(ip).fake?
end
|
.valid?(ip) ⇒ Boolean
32
33
34
|
# File 'lib/legitbot/botmatch.rb', line 32
def self.valid?(ip)
new(ip).valid?
end
|
Instance Method Details
#detected_as ⇒ Object
20
21
22
|
# File 'lib/legitbot/botmatch.rb', line 20
def detected_as
self.class.name.split('::').last.downcase.to_sym
end
|
#fake? ⇒ Boolean
28
29
30
|
# File 'lib/legitbot/botmatch.rb', line 28
def fake?
!valid?
end
|
#valid? ⇒ Boolean
24
25
26
|
# File 'lib/legitbot/botmatch.rb', line 24
def valid?
valid_ip? && valid_domain?
end
|