Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when formatting invalid numbers #40

Closed
espen opened this issue Dec 16, 2013 · 2 comments
Closed

Error when formatting invalid numbers #40

espen opened this issue Dec 16, 2013 · 2 comments

Comments

@espen
Copy link
Contributor

espen commented Dec 16, 2013

"+479090909".phony_formatted(:normalize => :NO, :format => :international)
NoMethodError: undefined method split' for 1:Fixnum from /phony-2.0.1/lib/phony/country_codes.rb:70:insplit'

+479090909 is missing a digit and is thus invalid. From Phony:

Phony.plausible?('+479090909', cc: '47')
=> false

@joost
Copy link
Owner

joost commented Dec 16, 2013

What would you return on invalid phone strings? An empty string? nil?

@espen
Copy link
Contributor Author

espen commented Dec 16, 2013

Well since this is a wrapper lib and the function is for formatting I think it should return nil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants