Sha256: b67ac5dd154c148229081564a1464f7c5f7b86156be480bf96bdd68bdf54bb72
Contents?: true
Size: 1.93 KB
Versions: 6
Compression:
Stored size: 1.93 KB
Contents
#-- # Ruby Whois # # An intelligent pure Ruby WHOIS client and parser. # # Copyright (c) 2009-2015 Simone Carletti <weppos@weppos.net> #++ require_relative 'base' module Whois class Parsers # Parser for the kero.yachay.pe server. # # @note This parser is just a stub and provides only a few basic methods # to check for domain availability and get domain status. # Please consider to contribute implementing missing methods. # # @see Whois::Parsers::Example # The Example parser for the list of all available methods. # class KeroYachayPe < Base property_supported :status do if content_for_scanner =~ /Status:\s+(.+?)\n/ case $1.downcase when "active" :registered # NEWSTATUS suspended (https://github.com/weppos/whois/issues/5) when "suspended" :registered when "not registered" :available when "inactive" :inactive else Whois.bug!(ParserError, "Unknown status `#{$1}'.") end else Whois.bug!(ParserError, "Unable to parse status.") end end property_supported :available? do status == :available end property_supported :registered? do !available? end property_not_supported :created_on property_not_supported :updated_on property_not_supported :expires_on property_supported :nameservers do if content_for_scanner =~ /Name Servers:\n((.+\n)+)\n/ $1.split("\n").map do |name| Parser::Nameserver.new(:name => name.strip) end end end # Checks whether the response has been throttled. # # @return [Boolean] # # @example # Looup quota exceeded. # def response_throttled? !content_for_scanner.match(/Looup quota exceeded./).nil? end end end end
Version data entries
6 entries across 6 versions & 2 rubygems