telephone_number 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/telephone_number.rb +13 -13
- data/lib/telephone_number/formatter.rb +2 -1
- data/lib/telephone_number/phone_data.rb +1 -1
- data/lib/telephone_number/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: 8ec98740cf5ff4f512dc0e165242a9993a0e760a
|
4
|
+
data.tar.gz: fcaf6262df680a30f38ecec2f1bf0489aaa20232
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f4fc7c229ea6ee79531eaff827dc40344c89f6ef5b708ecc73e214001db0e2f91567fdc208850b576a9cf5e2d4966b74dcf29dd80b9be8deef19856652dbeb0
|
7
|
+
data.tar.gz: 414ad7feb3095ea4d14cfd6e74591d344f00c6dea735dd2f198f554a119adc4ee77ac4022a9702cc67e46a07867fd355ebcab890edc91e96dd0b23602d72d683
|
data/lib/telephone_number.rb
CHANGED
@@ -14,35 +14,35 @@ module TelephoneNumber
|
|
14
14
|
extend ClassMethods
|
15
15
|
|
16
16
|
# allows users to override the default data
|
17
|
-
|
17
|
+
@override_file = nil
|
18
|
+
|
19
|
+
# allows users to provide a default format pattern
|
20
|
+
@default_format_pattern = nil
|
21
|
+
|
22
|
+
# allows users to provide a default format string
|
23
|
+
@default_format_string = nil
|
18
24
|
|
19
25
|
def self.override_file=(file_name)
|
20
|
-
|
26
|
+
@override_file = file_name
|
21
27
|
end
|
22
28
|
|
23
29
|
def self.override_file
|
24
|
-
|
30
|
+
@override_file
|
25
31
|
end
|
26
32
|
|
27
|
-
# allows users to provide a default format string
|
28
|
-
@@default_format_string = nil
|
29
|
-
|
30
33
|
def self.default_format_string=(format_string)
|
31
|
-
|
34
|
+
@default_format_string = format_string
|
32
35
|
end
|
33
36
|
|
34
37
|
def self.default_format_string
|
35
|
-
|
38
|
+
@default_format_string
|
36
39
|
end
|
37
40
|
|
38
|
-
# allows users to provide a default format pattern
|
39
|
-
@@default_format_pattern = nil
|
40
|
-
|
41
41
|
def self.default_format_pattern=(format_string)
|
42
|
-
|
42
|
+
@default_format_pattern = Regexp.new(format_string)
|
43
43
|
end
|
44
44
|
|
45
45
|
def self.default_format_pattern
|
46
|
-
|
46
|
+
@default_format_pattern
|
47
47
|
end
|
48
48
|
end
|
@@ -96,7 +96,8 @@ module TelephoneNumber
|
|
96
96
|
country_data[PhoneData::COUNTRY_CODE] == PhoneData.phone_data[self.country.to_sym][PhoneData::COUNTRY_CODE] \
|
97
97
|
&& country_data[PhoneData::MAIN_COUNTRY_FOR_CODE] == 'true'
|
98
98
|
end
|
99
|
-
|
99
|
+
|
100
|
+
detect_format(parent_country_code[0]) if parent_country_code
|
100
101
|
end
|
101
102
|
|
102
103
|
def detect_format(country_code)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: telephone_number
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MOBI Wireless Management
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|