Skip to content

Commit

Permalink
Merge pull request #38 from jschwertfeger/master
Browse files Browse the repository at this point in the history
Added phone format for Ghana (thanks jschwertfeger!)
  • Loading branch information
floere committed Mar 15, 2012
2 parents 97074ad + 2a6372e commit 9a4825a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/phony/countries.rb
Expand Up @@ -234,7 +234,13 @@
country '230', todo # Mauritius
country '231', todo # Liberia
country '232', todo # Sierra Leone
country '233', todo # Ghana

# Ghana
#
# From http://www.itu.int/oth/T0202000052/en
#
country '233', fixed(2) >> split(3,4)

country '234', todo # Nigeria
country '235', todo # Chad
country '236', todo # Central African Republic
Expand Down
3 changes: 3 additions & 0 deletions spec/lib/phony/countries_spec.rb
Expand Up @@ -94,6 +94,9 @@
Phony.split('491805878323').should == ['49', '180', '587', '8323'] # Service numbers
Phony.split('491815878323').should == ['49', '181', '587', '8323'] # Service numbers
end
it 'handles ghanese numbers' do
Phony.split('233302123456').should == ['233', '30', '212', '3456'] # Mobile Vodafone, Accra
end
it 'handles greek numbers' do
Phony.split('3021123456').should == ['30', '21', '123456'] # Athens
Phony.split('3069512345').should == ['30', '695', '12345'] # Mobile
Expand Down

0 comments on commit 9a4825a

Please sign in to comment.