Sha256: d394eec8f96f9eeb4fe308f8f0f73e28945fac248d32a14a2c4b607806e1442d
Contents?: true
Size: 710 Bytes
Versions: 40
Compression:
Stored size: 710 Bytes
Contents
# frozen_string_literal: true require_relative 'config/resolver' require_relative 'validators/domains' require_relative 'validators/ip_ranges' module Legitbot ## # Represents a bot instance match. Typical methods are # +valid?+, +fake?+ and +detected_as+ # class BotMatch include Legitbot::Validators::IpRanges include Legitbot::Validators::Domains def initialize(ip) @ip = ip end def detected_as self.class.name.split('::').last.downcase.to_sym end def valid? valid_ip? && valid_domain? end def fake? !valid? end def self.valid?(ip) new(ip).valid? end def self.fake?(ip) new(ip).fake? end end end
Version data entries
40 entries across 40 versions & 1 rubygems