to_phone 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/to_phone.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4c02f36c0b810935b0428504ffaf3cc3f0681e4
|
4
|
+
data.tar.gz: 78333b589646c0ca57bf7e8b285f7e819a319178
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c70be14e4f6318ea158a12e6373b4af80d6424bdb6a30e7ae26bd7c6316b9b96d5d1d5bb0184a4952d8d05823dad3e9ccc9109f133302f3440f64445113a5f8b
|
7
|
+
data.tar.gz: cc7b01d8ae4cdc013888657975b2a1c94f14e043b7ed7cd0cbc7cdb5d60d8fb81f601fefe5d54b4931c5e59da87161d209c31d91742e3f5f2abd4a44a17729fa
|
data/lib/to_phone.rb
CHANGED
@@ -17,7 +17,7 @@ module ToPhone
|
|
17
17
|
country_code = country_code.strip
|
18
18
|
country_code = '1' if country_code.nil? || country_code.empty?
|
19
19
|
country_code = country_code.to_s
|
20
|
-
number = number[country_code.length..-1] if number[0
|
20
|
+
number = number[country_code.length..-1] if number[0...country_code.length] == country_code
|
21
21
|
phone = Phoner::Phone.parse(number, country_code: country_code)
|
22
22
|
return phone
|
23
23
|
rescue Phoner::PhoneError
|