phonelib 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/phonelib/phone.rb +7 -0
- data/lib/phonelib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 600241b69c3b7265251dbf10a27bb30d91993532
|
4
|
+
data.tar.gz: 615d374f69715aac283827082f7523be1b09b093
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8872af94f450d20e9cf4328d40231c8571188db8720c84c60f8c3200bc4d52ae0190918e300b1a824aedac9debfd800c08c8f2928e91f40975782072d1e62af7
|
7
|
+
data.tar.gz: 67d32533b4522398ce681d8525406c2c6f56877d64f228d011aecc46e862fa47313b3cadf88b78a2b6bfe6d8588986e1934e89e53b1cafb267c3c05c768ea531
|
data/lib/phonelib/phone.rb
CHANGED
@@ -78,6 +78,13 @@ module Phonelib
|
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
81
|
+
# Returns the country code from the original phone number.
|
82
|
+
def country_code
|
83
|
+
if country_data = Phonelib.phone_data[country]
|
84
|
+
country_data[:country_code]
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
81
88
|
# Returns whether a current parsed phone number is valid
|
82
89
|
def valid?
|
83
90
|
@data.select { |iso2, data| data[:valid].any? }.any?
|
data/lib/phonelib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phonelib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vadim Senderovich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|