Sha256: cb8b64f8aecb270174953b68c55ca72186f2611b783b16013fab0315dfb24201

Contents?: true

Size: 750 Bytes

Versions: 2

Compression:

Stored size: 750 Bytes

Contents

class Whois::Domain::Ws < Whois::Domain::Base
  HOST = "whois.website.ws"
  ATTR_MATCH = /\s*([^:]+):\s+(.*)$/
  responds_to :ws

  ATTR_NAMES = {
    :registrar_name => "Registrar Name",
    :whois_server => "Registrar Whois",
    :created_on => "Domain Created",
    :updated_on => "Domain Last Updated",
    :expires_on => "Domain Currently Expires"
  }
  
  def available?
    @raw =~ /^No match/
  end

  def lookup_restricted?
    @raw =~ /You exceeded the maximum allowable number of whois lookups/
  end
  
  def name_servers
    found = false
    ns_ary = []
    @raw.each_line do |l|
      if l =~ /Current Nameservers:/
        found = true
      elsif found && l =~ /^\s*(\S+)/
        ns_ary << $1
      end
    end
    ns_ary
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jm81-whois-0.7.0 lib/whois/domain/ws.rb
jm81-whois-0.6.0 lib/whois/domain/ws.rb