提交 0d5d70f1 编写于 作者: S Santiago Pastorino

parse number only if options[:raise] is provided

上级 ea7db8eb
......@@ -52,10 +52,8 @@ def number_to_phone(number, options = {})
begin
Float(number)
rescue ArgumentError, TypeError
if options[:raise]
raise InvalidNumberError, number
end
end
end if options[:raise]
number = number.to_s.strip
options = options.symbolize_keys
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册