Module: SuckySocket::CountriesSocketsPlugs

Included in:
Country
Defined in:
lib/sucky_socket/countries_sockets_plugs.rb

Constant Summary collapse

COUNTRIES_SOCKETS =

this hash with country name as the key and an array of sockets that are used in this country

{
  "Abu Dhabi" => i(G),
  "Afghanistan" => i(C F),
  "Aland Islands" => i(C F),
  "Albania" => i(C F),
  "Algeria" => i(C F),
  "American Samoa" => i(A B F I),
  "Andorra" => i(C F),
  "Angola" => i(C F),
  "Anguilla" => i(A B),
  "Antigua And Barbuda" => i(A B),
  "Argentina" => i(C I),
  "Armenia" => i(C F),
  "Aruba" => i(A B F),
  "Australia" => i(I),
  "Austria" => i(C F),
  "Azerbaijan" => i(C F),
  "Azores" => i(A B C F),
  "Bahamas" => i(A B),
  "Bahrain" => i(G),
  "Balearic Island" => i(C F),
  "Bangladesh" => i(A C D G),
  "Barbados" => i(A B),
  "Belarus" => i(C F),
  "Belgium" => i(C E),
  "Belize" => i(A B G),
  "Benin" => i(C E),
  "Bermuda" => i(A B),
  "Bhutan" => i(C D G),
  "Bolivia" => i(A C),
  "Bonaire" => i(A C),
  "Bosnia and Herzegowina" => i(C F),
  "Botswana" => i(D G),
  "Brazil" => i(C N),
  "British Indian Ocean Territory" => i(A B),
  "British Virgin Islands" => i(A B),
  "Brunei" => i(G),
  "Bulgaria" => i(C F),
  "Burkina Faso" => i(C E),
  "Burundi" => i(C E),
  "Cambodia" => i(A C G),
  "Cameroon" => i(C E),
  "Canada" => i(A B),
  "Canary Islands" => i(C E F),
  "Cape Verde" => i(C F),
  "Cayman Islands" => i(A B),
  "Central African Republic" => i(C E),
  "Chad" => i(C E F),
  "Channel Islands" => i(C G),
  "Chile" => i(C L),
  "China" => i(A C I),
  "Christmas Island" => i(I),
  "Cocos (Keeling) Islands" => i(I),
  "Colombia" => i(A B),
  "Comoros" => i(C E),
  "Congo-Brazzaville" => i(C E),
  "Congo-Kinshasa" => i(C E),
  "Cook Islands" => i(I),
  "Costa Rica" => i(A B),
  "Cote d'Ivoire" => i(C E),
  "Croatia" => i(C F),
  "Cuba" => i(A B C L),
  "CuraƧao" => i(A B),
  "Cyprus" => i(G),
  "Czech Republic" => i(C E),
  "Denmark" => i(C E F K),
  "Djibouti" => i(C E),
  "Dominica" => i(D G),
  "Dominican Republic" => i(A B C),
  "Dubai" => i(G),
  "East-Timor" => i(C E F I),
  "Ecuador" => i(A B),
  "Egypt" => i(C F),
  "El Salvador" => i(A B),
  "England" => i(G),
  "Equatorial Guinea" => i(C E),
  "Eritrea" => i(C L),
  "Estonia" => i(C F),
  "Ethiopia" => i(C F G),
  "Falkland Islands (Malvinas)" => i(G),
  "Faroe Islands" => i(C E F K),
  "Fiji" => i(I),
  "Finland" => i(C F),
  "France" => i(C E),
  "French Guiana" => i(C E),
  "French Polynesia" => i(C E),
  "Gabon" => i(C E),
  "Gambia" => i(G),
  "Gaza" => i(C H),
  "Georgia" => i(C F),
  "Germany" => i(C F),
  "Ghana" => i(D G),
  "Gibraltar" => i(G),
  "Great Britain" => i(G),
  "Greece" => i(C F),
  "Greenland" => i(C E F K),
  "Grenada" => i(G),
  "Guadeloupe" => i(C E),
  "Guam" => i(A B),
  "Guatemala" => i(A B),
  "Guernsey" => i(C G),
  "Guinea" => i(C F),
  "Guinea-Bissau" => i(C E F),
  "Guyana" => i(A B D G),
  "Haiti" => i(A B),
  "Honduras" => i(A B),
  "Hong Kong" => i(G),
  "Hungary" => i(C F),
  "Iceland" => i(C F),
  "India" => i(C D M),
  "Indonesia" => i(C F),
  "Iran" => i(C F),
  "Iraq" => i(C D G),
  "Ireland" => i(G),
  "Isle of Man" => i(C G),
  "Israel" => i(C H),
  "Italy" => i(C F L),
  "Jamaica" => i(A B),
  "Japan" => i(A B),
  "Jersey" => i(C G),
  "Jordan" => i(C D F G J),
  "Kazakhstan" => i(C F),
  "Kenya" => i(G),
  "Kiribati" => i(I),
  "Kosovo" => i(C F),
  "Kuwait" => i(G),
  "Kyrgyzstan" => i(C F),
  "Laos" => i(A B C E F),
  "Latvia" => i(C F),
  "Lebanon" => i(C D G),
  "Lesotho" => i(M),
  "Liberia" => i(A B C F),
  "Libya" => i(C L),
  "Liechtenstein" => i(C J),
  "Lithuania" => i(C F),
  "Luxembourg" => i(C F),
  "Macao" => i(G),
  "Madagascar" => i(C E),
  "Madeira" => i(C F),
  "Malawi" => i(G),
  "Malaysia" => i(G),
  "Maldives" => i(C D G L),
  "Mali" => i(C E),
  "Malta" => i(G),
  "Marshall Islands" => i(A B),
  "Martinique" => i(C E),
  "Mauritania" => i(C E F),
  "Mauritius" => i(C G),
  "Mayotte" => i(C E),
  "Mexico" => i(A B),
  "Micronesia" => i(A B),
  "Moldova" => i(C F),
  "Monaco" => i(C E F),
  "Mongolia" => i(C F),
  "Montenegro" => i(C F),
  "Montserrat" => i(A B),
  "Morocco" => i(C E),
  "Mozambique" => i(C F M),
  "Myanmar" => i(A C D G I),
  "Namibia" => i(D M),
  "Nauru" => i(I),
  "Nepal" => i(C D M),
  "Netherlands" => i(C F),
  "Netherlands Antilles" => i(A B),
  "New Caledonia" => i(C E),
  "New Zealand" => i(I),
  "Nicaragua" => i(A B),
  "Niger" => i(C D E),
  "Nigeria" => i(D G),
  "Niue" => i(I),
  "Norfolk Island" => i(I),
  "North Korea" => i(C F),
  "North Macedonia" => i(C F),
  "Northern Ireland" => i(G),
  "Northern Mariana Islands" => i(A B),
  "Norway" => i(C F),
  "Oman" => i(G),
  "Pakistan" => i(C D),
  "Palau" => i(A B),
  "Palestine" => i(C H),
  "Panama" => i(A B),
  "Papua New Guinea" => i(I),
  "Paraguay" => i(A C),
  "Peru" => i(A B C),
  "Philippines" => i(A B C),
  "Pitcairn Islands" => i(I),
  "Poland" => i(C E),
  "Portugal" => i(C F),
  "Puerto Rico" => i(A B),
  "Qatar" => i(G),
  "Reunion" => i(C E),
  "Romania" => i(C F),
  "Russia" => i(C F),
  "Rwanda" => i(C E F G),
  "Saba" => i(A B),
  "Saint Barthelemy" => i(C E),
  "Saint Helena" => i(G),
  "Saint Kitts and Nevis" => i(D G),
  "Saint Lucia" => i(G),
  "Saint Martin" => i(C E),
  "Saint Pierre and Miquelon" => i(C E),
  "Saint Vincent and the Grenadines" => i(A B G),
  "Samoa" => i(I),
  "San Marino" => i(C F L),
  "Sao Tome and Principe" => i(C F),
  "Saudi Arabia" => i(G),
  "Scottland" => i(G),
  "Senegal" => i(C D E),
  "Serbia" => i(C F),
  "Seychelles" => i(G),
  "Sierra Leone" => i(D G),
  "Singapore" => i(G),
  "Sint Eustatius" => i(A B C F),
  "Sint Maarten" => i(A B),
  "Slovakia" => i(C E),
  "Slovenia" => i(C F),
  "Solomon Islands" => i(G I),
  "Somalia" => i(C G),
  "South Africa" => i(C M N),
  "South Korea" => i(C F),
  "South Sudan" => i(C D),
  "Spain" => i(C F),
  "Sri Lanka" => i(G),
  "Sudan" => i(C D),
  "Suriname" => i(A B C F),
  "Svalbard and Jan Mayen" => i(F),
  "Swaziland" => i(M),
  "Sweden" => i(C F),
  "Switzerland" => i(C J),
  "Syria" => i(C E L),
  "Tahiti" => i(C E),
  "Taiwan" => i(A B),
  "Tajikistan" => i(C F),
  "Tanzania" => i(D G),
  "Thailand" => i(A B C O),
  "Togo" => i(C E),
  "Tokelau" => i(I),
  "Tonga" => i(I),
  "Trinidad and Tobago" => i(A B),
  "Tunisia" => i(C E),
  "Turkey" => i(C F),
  "Turkmenistan" => i(C F),
  "Turks and Caicos Islands" => i(A B),
  "Tuvalu" => i(I),
  "Uganda" => i(G),
  "Ukraine" => i(C F),
  "United Arab Emirates" => i(G),
  "United Kingdom" => i(G),
  "United States" => i(A B),
  "United States of America" => i(A B),
  "USA" => i(A B),
  "United States Virgin Islands" => i(A B),
  "Uruguay" => i(C F L),
  "Uzbekistan" => i(C F),
  "Vanuatu" => i(I),
  "Vatican City" => i(C F L),
  "Venezuela" => i(A B),
  "Vietnam" => i(A B C),
  "Wales" => i(G),
  "Wallis and Futuna" => i(C E),
  "West Bank" => i(C H),
  "Western Sahara" => i(C E),
  "Yemen" => i(A D G),
  "Zambia" => i(C D G),
  "Zimbabwe" => i(D G)
}
SOCKETS_PLUGS =

A hash with a socket type as the key and and array with plugs that fit that particular socket

{
  :A => i(A),
  :B => i(A B),
  :C => i(C E F),
  :D => i(D),
  :E => i(C E),
  :F => i(C E F),
  :G => i(G),
  :I => i(I),
  :J => i(C J),
  :K => i(C E F K),
  :L => i(C L),
  :M => i(M),
  :N => i(C N),
  :O => i(C O)
}

Instance Method Summary collapse

Instance Method Details

#get_plugs(socket) ⇒ Object

Gets the array of plugs that fit the socket given as the parameter



296
297
298
# File 'lib/sucky_socket/countries_sockets_plugs.rb', line 296

def get_plugs(socket)
  SOCKETS_PLUGS[socket]
end

#get_sockets(country) ⇒ Object

Gets the array of sockets for the country given as the parameter



291
292
293
# File 'lib/sucky_socket/countries_sockets_plugs.rb', line 291

def get_sockets(country)
  COUNTRIES_SOCKETS[country]
end

#validate_country_name(country) ⇒ Object

Checks if the country given as the parameter is included in the hash COUNTRIES_SOCKETS and is therewith a valid country name



301
302
303
# File 'lib/sucky_socket/countries_sockets_plugs.rb', line 301

def validate_country_name(country)
  COUNTRIES_SOCKETS.include?(country)
end