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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f3eeaae7e2665770a20e0402766cdc7e0635fd49
4
- data.tar.gz: f67f713ed9d06b10856c7a026580131fd2a1fbdc
3
+ metadata.gz: 174e630520237bdaa586ced9fb407cb5f9d29147
4
+ data.tar.gz: 703a9a25cee1fc160cea4a868a1840f318855e96
5
5
  SHA512:
6
- metadata.gz: 45cbe2012cc63feff2b0ace61aeb2880bc3be47fdcc796f1f2312c10978eda9162c172fe171f63461515dd114da4b092ab5e21bbeb9293ee8c14b4ea2998548f
7
- data.tar.gz: e3c26331327591aaab06d3703e859e18813336cc05ae1bd984a90d4e73e8be2a0ac7a30343bbb128037de8537cbf7c461fbdaecd22ed0408c7306e612389d65c
6
+ metadata.gz: 708281610f11bff82e87969ae22755829b9bef001550aa16fa0672f433460b9e1d675a0154da12e699e1f46de90a7fbe500fa1436c8050d803d2bd55647bd9ac
7
+ data.tar.gz: 8297d0cf8e85d3edc5e5f03b30cf14058156b2b4ba2a36a851143e48c3aa6a0cb2c993ec80871efc8258360d733b50703a80f53ed5594f2fdfc9a5b79f3739a4
@@ -1,3 +1,3 @@
1
1
  module Jisx0402
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jisx0402
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - cnosuke