Sha256: 616ee793b3cd31dda801815d4d4ec13f517e670fe9affccc8b2cf910170a23c2

Contents?: true

Size: 1.52 KB

Versions: 11

Compression:

Stored size: 1.52 KB

Contents

require 'rubygems'
require 'iso_country_codes'

class TLD
  class Name
    NAME_MAP = {
      :aero      => 'Aeroplane',
      :arpa      => 'Address and Routing Parameter Area (ARPA)',
      :asia      => 'Asia',
      :bitnet    => 'BITNET',
      :biz       => 'Business',
      :cat       => 'Catalan',
      :com       => 'Commercial',
      :coop      => 'Cooperative',
      :csnet     => 'Computer Science Network (CSNET)',
      :edu       => 'Education',
      :eu        => 'European Union',
      :example   => 'Example domain',
      :exit      => 'Preferred Tor exit node',
      :gov       => 'US Government',
      :info      => 'Information',
      :int       => 'Internet',
      :invalid   => 'Invalid domain',
      :jobs      => 'Jobs',
      :local     => 'Network discovery protocol',
      :localhost => 'Localhost',
      :mil       => 'US Military',
      :mobi      => 'Mobile',
      :museum    => 'Museum',
      :name      => 'Name',
      :nato      => 'North Atlantic Treaty Organization (NATO)',
      :net       => 'Network',
      :onion     => 'Reachable via Tor',
      :org       => 'Organization',
      :pro       => 'Professional',
      :root      => 'Diagnostic marker',
      :tel       => 'Telnic',
      :test      => 'Test domain',
      :travel    => 'Travel',
      :uucp      => 'Reachable by Unix to Unix CoPy (UUCP)'
    }

    class << self
      def find(klass)
        tld = klass.tld
        NAME_MAP[tld.to_sym] || IsoCountryCodes.find(TLD::MAP[tld.to_sym] || tld).name
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
tld-0.7.1 lib/tld/name.rb
tld-0.7.0 lib/tld/name.rb
alexrabarts-tld-0.2.0 lib/tld/name.rb
alexrabarts-tld-0.2.1 lib/tld/name.rb
alexrabarts-tld-0.4.0 lib/tld/name.rb
alexrabarts-tld-0.5.0 lib/tld/name.rb
alexrabarts-tld-0.6.0 lib/tld/name.rb
tld-0.6.4 lib/tld/name.rb
tld-0.6.3 lib/tld/name.rb
tld-0.6.2 lib/tld/name.rb
tld-0.6.1 lib/tld/name.rb