Country codes and dial codes ruby
arrays, hash, ruby
Solution
Before reinventing the wheel, you should check existing solutions like the countries gem:
c.number #=> "840"
c.alpha2 #=> "US"
c.alpha3 #=> "USA"
c.country_code #=> "1"
c.national_destination_code_lengths #=> 3
c.national_number_lengths #=> 10
c.international_prefix #=> "011"
c.national_prefix #=> "1"
Problem
Im doing a little project which involves - country list - country abbreviation list e.g UK, US. - dial code. if a user enters +44, it should pull the country and country abbreviation I was wondering what the best way to implement this is? shall i create 3 different hashes? or use nested hashes?