diff --git a/lib/phony/countries.rb b/lib/phony/countries.rb index 9fe4fdaf..d5b77793 100644 --- a/lib/phony/countries.rb +++ b/lib/phony/countries.rb @@ -275,6 +275,10 @@ match(/^(2\d)\d{8}$/) >> split(2, 3, 3) | match(/^(800)\d{6}$/) >> split(3, 3) | # International 800 service where agreed match(/^(800)\d{7}$/) >> split(3, 4) | # International 800 service where agreed + match(/^(508)\d{6}$/) >> split(3, 3) | # Toll-free 0508 + match(/^(508)\d{7}$/) >> split(3, 4) | # Toll-free 0508 + match(/^(900)\d{5}$/) >> split(3, 2) | # Premium rate 0900 + match(/^(900)\d{6}$/) >> split(3, 3) | # Premium rate 0900 fixed(1) >> split(3, 4) # Rest # Singapore (Republic of). diff --git a/spec/lib/phony/countries_spec.rb b/spec/lib/phony/countries_spec.rb index ec81c028..dd73f4c5 100644 --- a/spec/lib/phony/countries_spec.rb +++ b/spec/lib/phony/countries_spec.rb @@ -947,6 +947,10 @@ def self.it_splits(number, expected) it_splits '6491234567', %w[64 9 123 4567] it_splits '64800123123', %w[64 800 123 123] it_splits '648001231234', %w[64 800 123 1234] + it_splits '64508123123', %w[64 508 123 123] # Toll-free 0508 + it_splits '645081231234', %w[64 508 123 1234] # Toll-free 0508 + it_splits '6490012345', %w[64 900 123 45] # Premium 0900 (5 digits) + it_splits '64900123456', %w[64 900 123 456] # Premium 0900 (6 digits) end describe 'Bhutan (Kingdom of)' do