big-phoney 0.0.9 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/big-phoney.gemspec +1 -1
- data/lib/big_phoney/phone_number.rb +4 -0
- data/lib/big_phoney/rails.rb +1 -1
- metadata +3 -3
data/big-phoney.gemspec
CHANGED
@@ -30,6 +30,10 @@ module BigPhoney
|
|
30
30
|
976 977 979 991 992 993 994 995 996
|
31
31
|
998
|
32
32
|
]
|
33
|
+
AREA_CODES = {
|
34
|
+
:canada => %w[204 250 289 306 403 416 418 450 506 514 519 604 613 647 705 709 778 780 807 819 867 902 905],
|
35
|
+
:puero_rico => %w[787 939]
|
36
|
+
}
|
33
37
|
|
34
38
|
def self.assume_us? ; @assume_us end
|
35
39
|
def self.assume_us=(us) ; @assume_us = us end
|
data/lib/big_phoney/rails.rb
CHANGED
@@ -6,7 +6,7 @@ module BigPhoney
|
|
6
6
|
define_method("#{field}=") do |value|
|
7
7
|
return true if value.blank?
|
8
8
|
just_digits = value.to_s.gsub(/[^\d]/, "")
|
9
|
-
self[field] = (
|
9
|
+
self[field] = (just_digits.starts_with?("1") ? just_digits[1..-1] : just_digits)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: big-phoney
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 0.0.9
|
10
|
+
version: 0.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Pat Nakajima
|