Method: Phonelib::PhoneFormatter#country_code

Defined in:
lib/phonelib/phone_formatter.rb

#country_codeString

Returns the country code from the original phone number.

Returns:

  • (String)

    matched country phone code



34
35
36
37
# File 'lib/phonelib/phone_formatter.rb', line 34

def country_code
  @country_code ||= Phonelib.phone_data[country] && \
                    Phonelib.phone_data[country][Core::COUNTRY_CODE]
end