Module: InternetBS

Defined in:
lib/internetbs.rb,
lib/internetbs/base.rb,
lib/internetbs/error.rb,
lib/internetbs/client.rb,
lib/internetbs/version.rb,
lib/internetbs/domain_host.rb,
lib/internetbs/domain_push.rb,
lib/internetbs/domain_hosts.rb,
lib/internetbs/domain_total.rb,
lib/internetbs/order_domain.rb,
lib/internetbs/renew_domain.rb,
lib/internetbs/account_price.rb,
lib/internetbs/configuration.rb,
lib/internetbs/country_codes.rb,
lib/internetbs/domain_record.rb,
lib/internetbs/private_whois.rb,
lib/internetbs/update_domain.rb,
lib/internetbs/account_domain.rb,
lib/internetbs/account_prices.rb,
lib/internetbs/domain_contact.rb,
lib/internetbs/domain_records.rb,
lib/internetbs/registrar_lock.rb,
lib/internetbs/account_balance.rb,
lib/internetbs/account_domains.rb,
lib/internetbs/registry_status.rb,
lib/internetbs/account_balances.rb,
lib/internetbs/dot_de_attributes.rb,
lib/internetbs/dot_eu_attributes.rb,
lib/internetbs/dot_it_attributes.rb,
lib/internetbs/dot_nl_attributes.rb,
lib/internetbs/dot_uk_attributes.rb,
lib/internetbs/dot_us_attributes.rb,
lib/internetbs/account_transaction.rb,
lib/internetbs/domain_availability.rb,
lib/internetbs/dot_asia_attributes.rb,
lib/internetbs/account_transactions.rb,
lib/internetbs/additional_attributes.rb

Defined Under Namespace

Modules: VERSION Classes: AccountBalance, AccountBalances, AccountDomain, AccountDomains, AccountPrice, AccountPrices, AccountTransaction, AccountTransactions, AdditionalAttributes, Base, Client, Configuration, DomainAvailability, DomainContact, DomainHost, DomainHosts, DomainPush, DomainRecord, DomainRecords, DomainTotal, DotAsiaAttributes, DotDEAttributes, DotEUAttributes, DotITAttributes, DotNLAttributes, DotUKAttributes, DotUSAttributes, Error, OrderDomain, PrivateWhois, RegistrarLock, RegistryStatus, RenewDomain, UpdateDomain

Constant Summary collapse

COUNTRY_CODES =

This list is derived from en.wikipedia.org/wiki/ISO_3166-1_alpha-2. The hash keys are ISO_3166-1_alpha-2 codes and the values are the country display name. The top 20 countries by number of Internet users are grouped first, see en.wikipedia.org/wiki/List_of_countries_by_number_of_Internet_users.

{
  "BR" =>	"Brazil",
  "CA" =>	"Canada",	
  "CN" =>	"China",	
  "EG" =>	"Egypt",	
  "FR" =>	"France",	
  "DE" =>	"Germany",	
  "IN" =>	"India",	
  "ID" =>	"Indonesia",	
  "IT" =>	"Italy",	
  "JP" =>	"Japan",	
  "MX" =>	"Mexico",	
  "NG" =>	"Nigeria",	
  "PH" =>	"Philippines",	
  "RU" =>	"Russian Federation",
  "ES" =>	"Spain",	
  "KR" =>	"South Korea",
  "TR" =>	"Turkey",	
  "GB" =>	"United Kingdom",	
  "US" =>	"United States",	
  "VN" =>	"Vietnam",
  "AD" =>	"Andorra",	
  "AE" =>	"United Arab Emirates",	
  "AF" =>	"Afghanistan",	
  "AG" =>	"Antigua and Barbuda",	
  "AI" =>	"Anguilla",	
  "AL" =>	"Albania",	
  "AM" =>	"Armenia",	
  "AO" =>	"Angola",	
  "AQ" =>	"Antarctica",	
  "AR" =>	"Argentina",	
  "AS" =>	"American Samoa",	
  "AT" =>	"Austria",	
  "AU" =>	"Australia",	
  "AW" =>	"Aruba",	
  "AX" =>	"Åland Islands",	
  "AZ" =>	"Azerbaijan",	
  "BA" =>	"Bosnia and Herzegovina",	
  "BB" =>	"Barbados",	
  "BD" =>	"Bangladesh",	
  "BE" =>	"Belgium",	
  "BF" =>	"Burkina Faso",	
  "BG" =>	"Bulgaria",	
  "BH" =>	"Bahrain",	
  "BI" =>	"Burundi",	
  "BJ" =>	"Benin",	
  "BL" =>	"Saint Barthélemy",	
  "BM" =>	"Bermuda",	
  "BN" =>	"Brunei",
  "BO" =>	"Bolivia",
  "BQ" =>	"Bonaire, Sint Eustatius and Saba	Caribbean Netherlands",
  "BS" =>	"Bahamas",
  "BT" =>	"Bhutan",	
  "BV" =>	"Bouvet Island",	
  "BW" =>	"Botswana",	
  "BY" =>	"Belarus",	
  "BZ" =>	"Belize",	
  "CC" =>	"Cocos (Keeling) Islands",	
  "CD" =>	"Congo, the Democratic Republic of",
  "CF" =>	"Central African Republic",	
  "CG" =>	"Congo",
  "CH" =>	"Switzerland",	
  "CI" =>	"Côte d'Ivoire",	
  "CK" =>	"Cook Islands",	
  "CL" =>	"Chile",	
  "CM" =>	"Cameroon",	
  "CO" =>	"Colombia",	
  "CR" =>	"Costa Rica",	
  "CU" =>	"Cuba",	
  "CV" =>	"Cabo Verde",	
  "CW" =>	"Curaçao",	
  "CX" =>	"Christmas Island",	
  "CY" =>	"Cyprus",	
  "CZ" =>	"Czech Republic",	
  "DJ" =>	"Djibouti",	
  "DK" =>	"Denmark",	
  "DM" =>	"Dominica",	
  "DO" =>	"Dominican Republic",	
  "DZ" =>	"Algeria",	
  "EC" =>	"Ecuador",	
  "EE" =>	"Estonia",	
  "EH" =>	"Western Sahara",	
  "ER" =>	"Eritrea",	
  "ET" =>	"Ethiopia",	
  "FI" =>	"Finland",	
  "FJ" =>	"Fiji",	
  "FK" =>	"Falkland Islands (Malvinas)",
  "FM" =>	"Federated States of Micronesia",
  "FO" =>	"Faroe Islands",	
  "GA" =>	"Gabon",	
  "GD" =>	"Grenada",	
  "GE" =>	"Georgia",
  "GF" =>	"French Guiana",	
  "GG" =>	"Guernsey",	
  "GH" =>	"Ghana",	
  "GI" =>	"Gibraltar",	
  "GL" =>	"Greenland",	
  "GM" =>	"Gambia",
  "GN" =>	"Guinea",	
  "GP" =>	"Guadeloupe",	
  "GQ" =>	"Equatorial Guinea",	
  "GR" =>	"Greece",	
  "GS" =>	"South Georgia and the South Sandwich Islands",	
  "GT" =>	"Guatemala",	
  "GU" =>	"Guam",	
  "GW" =>	"Guinea-Bissau",	
  "GY" =>	"Guyana",	
  "HK" =>	"Hong Kong",	
  "HM" =>	"Heard Island and McDonald Islands",	
  "HN" =>	"Honduras",	
  "HR" =>	"Croatia",	
  "HT" =>	"Haiti",	
  "HU" =>	"Hungary",	
  "IE" =>	"Ireland",
  "IL" =>	"Israel",	
  "IM" =>	"Isle of Man",	
  "IO" =>	"British Indian Ocean Territory",	
  "IQ" =>	"Iraq",	
  "IR" =>	"Iran",
  "IS" =>	"Iceland",	
  "JE" =>	"Jersey",	
  "JM" =>	"Jamaica",	
  "JO" =>	"Jordan",	
  "KE" =>	"Kenya",	
  "KG" =>	"Kyrgyzstan",	
  "KH" =>	"Cambodia",	
  "KI" =>	"Kiribati",	
  "KM" =>	"Comoros",	
  "KN" =>	"Saint Kitts and Nevis",	
  "KP" =>	"North Korea",
  "KW" =>	"Kuwait",	
  "KY" =>	"Cayman Islands",	
  "KZ" =>	"Kazakhstan",	
  "LA" =>	"Laos",
  "LB" =>	"Lebanon",	
  "LC" =>	"Saint Lucia",	
  "LI" =>	"Liechtenstein",	
  "LK" =>	"Sri Lanka",	
  "LR" =>	"Liberia",	
  "LS" =>	"Lesotho",	
  "LT" =>	"Lithuania",	
  "LU" =>	"Luxembourg",	
  "LV" =>	"Latvia",	
  "LY" =>	"Libya",	
  "MA" =>	"Morocco",	
  "MC" =>	"Monaco",	
  "MD" =>	"Moldova",
  "ME" =>	"Montenegro",	
  "MF" =>	"Saint Martin (French part)", 
  "MG" =>	"Madagascar",	
  "MH" =>	"Marshall Islands",	
  "MK" =>	"Macedonia",
  "ML" =>	"Mali",	
  "MM" =>	"Myanmar",	
  "MN" =>	"Mongolia",	
  "MO" =>	"Macao",
  "MP" =>	"Northern Mariana Islands",	
  "MQ" =>	"Martinique",	
  "MR" =>	"Mauritania",	
  "MS" =>	"Montserrat",	
  "MT" =>	"Malta",	
  "MU" =>	"Mauritius",	
  "MV" =>	"Maldives",	
  "MW" =>	"Malawi",	
  "MY" =>	"Malaysia",	
  "MZ" =>	"Mozambique",	
  "NA" =>	"Namibia",	
  "NC" =>	"New Caledonia",	
  "NE" =>	"Niger",	
  "NF" =>	"Norfolk Island",	
  "NI" =>	"Nicaragua",	
  "NL" =>	"Netherlands",	
  "NO" =>	"Norway",
  "NP" =>	"Nepal",	
  "NR" =>	"Nauru",	
  "NU" =>	"Niue",	
  "NZ" =>	"New Zealand",	
  "OM" =>	"Oman",	
  "PA" =>	"Panama",	
  "PE" =>	"Peru",	
  "PF" =>	"French Polynesia",	
  "PG" =>	"Papua New Guinea",	
  "PK" =>	"Pakistan",	
  "PL" =>	"Poland",	
  "PM" =>	"Saint Pierre and Miquelon",	
  "PN" =>	"Pitcairn",
  "PR" =>	"Puerto Rico",	
  "PS" =>	"Palestine",
  "PT" =>	"Portugal",	
  "PW" =>	"Palau",	
  "PY" =>	"Paraguay",	
  "QA" =>	"Qatar",	
  "RE" =>	"Réunion",	
  "RO" =>	"Romania",	
  "RS" =>	"Serbia",	
  "RW" =>	"Rwanda",	
  "SA" =>	"Saudi Arabia",	
  "SB" =>	"Solomon Islands",	
  "SC" =>	"Seychelles",	
  "SD" =>	"Sudan",	
  "SE" =>	"Sweden",	
  "SG" =>	"Singapore",	
  "SH" =>	"Saint Helena, Ascension and Tristan da Cunha",	
  "SI" =>	"Slovenia",	
  "SJ" =>	"Svalbard and Jan Mayen",	
  "SK" =>	"Slovakia",	
  "SL" =>	"Sierra Leone",	
  "SM" =>	"San Marino",	
  "SN" =>	"Senegal",	
  "SO" =>	"Somalia",	
  "SR" =>	"Suriname",	
  "SS" =>	"South Sudan",	
  "ST" =>	"Sao Tome and Principe",
  "SV" =>	"El Salvador",	
  "SX" =>	"Sint Maarten (Dutch part)",
  "SY" =>	"Syria",
  "SZ" =>	"Swaziland",	
  "TC" =>	"Turks and Caicos Islands",	
  "TD" =>	"Chad",	
  "TF" =>	"French Southern Territories",
  "TG" =>	"Togo",	
  "TH" =>	"Thailand",	
  "TJ" =>	"Tajikistan",	
  "TK" =>	"Tokelau",	
  "TL" =>	"Timor-Leste",
  "TM" =>	"Turkmenistan",	
  "TN" =>	"Tunisia",	
  "TO" =>	"Tonga",	
  "TT" =>	"Trinidad and Tobago",	
  "TV" =>	"Tuvalu",	
  "TW" =>	"Taiwan",	
  "TZ" =>	"Tanzania",
  "UA" =>	"Ukraine",	
  "UG" =>	"Uganda",	
  "UM" =>	"United States Minor Outlying Islands",	
  "UY" =>	"Uruguay",	
  "UZ" =>	"Uzbekistan",	
  "VA" =>	"Vatican City",
  "VC" =>	"Saint Vincent and the Grenadines",	
  "VE" =>	"Venezuela",
  "VG" =>	"Virgin Islands, British",
  "VI" =>	"Virgin Islands, U.S.",
  "VU" =>	"Vanuatu",	
  "WF" =>	"Wallis and Futuna",	
  "WS" =>	"Samoa",	
  "YE" =>	"Yemen",	
  "YT" =>	"Mayotte",	
  "ZA" =>	"South Africa",	
  "ZM" =>	"Zambia",	
  "ZW" =>	"Zimbabwe"	
}
COUNTRY_CODES_EU =
{
  "AT" =>	"Austria",
  "BE" =>	"Belgium",
  "BG" =>	"Bulgaria",
  "HR" =>	"Croatia",
  "CY" =>	"Cyprus",
  "CZ" =>	"Czech Republic",
  "DK" =>	"Denmark",
  "EE" =>	"Estonia",
  "FI" =>	"Finland",
  "FR" =>	"France",
  "DE" =>	"Germany",
  "GR" =>	"Greece",
  "HU" =>	"Hungary",
  "IE" =>	"Ireland",
  "IT" =>	"Italy",
  "LV" =>	"Latvia",
  "LT" =>	"Lithuania",
  "LU" =>	"Luxembourg",
  "MT" =>	"Malta",
  "NL" =>	"Netherlands",
  "PL" =>	"Poland",
  "PT" =>	"Portugal",
  "RO" =>	"Romania",
  "SK" =>	"Slovakia",
  "SI" =>	"Slovenia",
  "ES" =>	"Spain",
  "SE" =>	"Sweden",
  "GB" =>	"United Kingdom"
}
@@configuration =
nil

Class Method Summary collapse

Class Method Details

.configurationObject



45
46
47
# File 'lib/internetbs.rb', line 45

def self.configuration
  @@configuration || configure
end

.configure {|configuration| ... } ⇒ Object

Yields:



39
40
41
42
43
# File 'lib/internetbs.rb', line 39

def self.configure
  @@configuration = Configuration.new
  yield(configuration) if block_given?
  configuration
end

.method_missing(method_sym, *arguments, &block) ⇒ Object



49
50
51
52
53
54
55
# File 'lib/internetbs.rb', line 49

def self.method_missing(method_sym, *arguments, &block)
  if configuration.respond_to?(method_sym)
    configuration.send(method_sym)
  else
    super
  end
end

.respond_to?(method_sym, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


57
58
59
60
61
62
63
# File 'lib/internetbs.rb', line 57

def self.respond_to?(method_sym, include_private = false)
  if configuration.respond_to?(method_sym, include_private)
    true
  else
    super
  end    
end