Skip to content
This repository was archived by the owner on Jun 10, 2018. It is now read-only.
This repository was archived by the owner on Jun 10, 2018. It is now read-only.

recognizing Vatican, Kosovo, etc. #45

@mcr

Description

@mcr

I realize that GlobalPhone seems to be more focused on formatting than lookup of number to country code, but it seems that it ignores info that has, for instance the "exception" for the Vatican it clearly knows about, but doesn't return. (Similar things would be for Kosovo and some other places)

2.1.5 :014 > number = GlobalPhone.parse('+390669822222')
 => #<GlobalPhone::Number territory=#<GlobalPhone::Territory country_code=39 name=IT> national_string="0669822222"> 
2.1.5 :015 > number.territory 
 => #<GlobalPhone::Territory country_code=39 name=IT> 
2.1.5 :016 > number.region   
 => #<GlobalPhone::Region country_code=39 territories=[IT,VA]> 
2.1.5 :017 > 

I think it ought to return name=VA for this, since clearly it knows about VA's use of an IT prefix.
I could write a test and fix this, but maybe it's not important enough for others. https://github.com/hemligabyran/calling_codes probably satisfies my needs, except I worry about it getting out of date.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions