Sha256: 155d39553be18f60aface06145e2d81fa80878112d4a848024309f435ceebf7a
Contents?: true
Size: 1.15 KB
Versions: 3
Compression:
Stored size: 1.15 KB
Contents
#-- # Ruby Whois # # An intelligent pure Ruby WHOIS client and parser. # # Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net> #++ module Whois class Server module Adapters # # = Afilias Adapter # # Provides ability to query Afilias WHOIS interfaces. # class Afilias < Base # Executes a WHOIS query to the Afilias WHOIS interface, # resolving any intermediate referral, # and appends the response to the client buffer. # # @param [String] string # @return [void] # def request(string) response = query_the_socket(string, host) buffer_append response, host if options[:referral] != false && (referral = extract_referral(response)) response = query_the_socket(string, referral) buffer_append(response, referral) end end private def extract_referral(response) return unless (match = response.match(/Registrar WHOIS Server:(.+?)$/)) server = match[match.size - 1].strip server.empty? ? nil : server end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
whois-4.0.8 | lib/whois/server/adapters/afilias.rb |
whois-4.0.7 | lib/whois/server/adapters/afilias.rb |
whois-4.0.6 | lib/whois/server/adapters/afilias.rb |