Sha256: 9326c09dfc5036958f5617b9d75585cd64228457a721b2ca4d61c6b94f6847b6

Contents?: true

Size: 1.63 KB

Versions: 27

Compression:

Stored size: 1.63 KB

Contents

#--
# Ruby Whois
#
# An intelligent pure Ruby WHOIS client and parser.
#
# Copyright (c) 2009-2012 Simone Carletti <weppos@weppos.net>
#++

require 'whois/record/parser/base'

module Whois
  class Record
    class Parser

      # Parser for the whois.registrygate.com server, added by Yang Li 02/10/2013.
      class WhoisRegistrygateCom < Base

		property_supported :admin_contacts do
          build_contact("admin-", Whois::Record::Contact::TYPE_ADMIN)
        end

        property_supported :registrant_contacts do
          build_contact("owner-", Whois::Record::Contact::TYPE_REGISTRANT)
        end

        property_supported :technical_contacts do
          build_contact("tech-", Whois::Record::Contact::TYPE_TECHNICAL)
        end

        property_not_supported :billing_contacts 
	
      private

        def build_contact(element, type)
          reg=Record::Contact.new(:type => type)
		  content_for_scanner.scan(/^(#{element}.*):\s+(.+)\n/).map do |entry|
              reg["id"]=entry[1] if entry[0] =~ /id/i
              reg["name"]=entry[1] if entry[0] =~ /name/i		  
              reg["organization"]=entry[1] if entry[0]=~ /org/i
              reg["address"]=entry[1] if entry[0]=~ /address/i
              reg["city"]= entry[1] if entry[0]=~ /city/i
              reg["zip"]=entry[1] if entry[0]=~ /pcode/i
              reg["state"]=entry[1] if entry[0]=~ /state/i
			  reg["country_code"]=entry[1] if entry[0]=~ /country/i
			  reg["phone"]=entry[1] if entry[0]=~ /phone/i
			  reg["fax"]=entry[1] if entry[0]=~ /fax/i
			  reg["email"]=entry[1] if entry[0]=~ /email/i
          end
		  return reg
        end	
		
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
wmap-2.7.2 ruby_whois_patches/whois.registrygate.com.rb
wmap-2.7.1 ruby_whois_patches/whois.registrygate.com.rb
wmap-2.7.0 ruby_whois_patches/whois.registrygate.com.rb
wmap-2.6.9 ruby_whois_patches/whois.registrygate.com.rb
wmap-2.6.8 ruby_whois_patches/whois.registrygate.com.rb
wmap-2.6.7 ruby_whois_patches/whois.registrygate.com.rb
wmap-2.6.6 ruby_whois_patches/whois.registrygate.com.rb
wmap-2.6.5 ruby_whois_patches/whois.registrygate.com.rb
wmap-2.6.4 ruby_whois_patches/whois.registrygate.com.rb
wmap-2.6.3 ruby_whois_patches/whois.registrygate.com.rb
wmap-2.6.2 ruby_whois_patches/whois.registrygate.com.rb
wmap-2.6.1 ruby_whois_patches/whois.registrygate.com.rb
wmap-2.6.0 ruby_whois_patches/whois.registrygate.com.rb
wmap-2.5.9 ruby_whois_patches/whois.registrygate.com.rb
wmap-2.5.8 ruby_whois_patches/whois.registrygate.com.rb
wmap-2.5.7 ruby_whois_patches/whois.registrygate.com.rb
wmap-2.5.6 ruby_whois_patches/whois.registrygate.com.rb
wmap-2.5.5 ruby_whois_patches/whois.registrygate.com.rb
wmap-2.5.4 ruby_whois_patches/whois.registrygate.com.rb
wmap-2.5.2 ruby_whois_patches/whois.registrygate.com.rb