jisx0402 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jisx0402/version.rb +1 -1
- data/lib/jisx0402.rb +4 -0
- 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: 174e630520237bdaa586ced9fb407cb5f9d29147
|
4
|
+
data.tar.gz: 703a9a25cee1fc160cea4a868a1840f318855e96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 708281610f11bff82e87969ae22755829b9bef001550aa16fa0672f433460b9e1d675a0154da12e699e1f46de90a7fbe500fa1436c8050d803d2bd55647bd9ac
|
7
|
+
data.tar.gz: 8297d0cf8e85d3edc5e5f03b30cf14058156b2b4ba2a36a851143e48c3aa6a0cb2c993ec80871efc8258360d733b50703a80f53ed5594f2fdfc9a5b79f3739a4
|
data/lib/jisx0402/version.rb
CHANGED
data/lib/jisx0402.rb
CHANGED
@@ -12,6 +12,8 @@ module Jisx0402
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def find_by_code(c)
|
15
|
+
return nil if !c || c.size == 0
|
16
|
+
|
15
17
|
code = c.to_s
|
16
18
|
if code.size == 2 && (1..47).cover?(code.to_i)
|
17
19
|
code_without_checkdigit = "#{code}000" # 都道府県
|
@@ -188,6 +190,8 @@ module Jisx0402
|
|
188
190
|
end
|
189
191
|
|
190
192
|
def cover?(c)
|
193
|
+
return false if !c || c.size == 0
|
194
|
+
|
191
195
|
area_code = c.to_s
|
192
196
|
if prefecture?
|
193
197
|
area_code.start_with?(prefecture_code)
|