randwordjp 0.1.3 → 0.1.4
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.
- checksums.yaml +4 -4
- data/lib/randwordjp.rb +8 -1
- data/lib/randwordjp/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: 9018f82c6e18a622fb6056fefdb00ff71b27a316
|
4
|
+
data.tar.gz: 38213fd2e887596f742c8f28b651417907f3bb02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17ee45e7f2790646ab13c28a2bfe36a7f42c8b0ad0b904f216a681ffd6ac69ff81c7def5d05ca33fc86580feb38675603b103fbac32e5e3a581314b828925d4c
|
7
|
+
data.tar.gz: 0aae35905bc685a5dacd60b61977963bf33ecceca87757391985ea923dfc266399620ab5cd9ff83e607b9708654289ae8f443c8d5c7ceba094ff206ca87ca640
|
data/lib/randwordjp.rb
CHANGED
@@ -260,7 +260,7 @@ module Randwordjp
|
|
260
260
|
# 日本の住所(都道府県、市区町村、字町名)を取得します
|
261
261
|
# @param [Hash] opts オプション設定
|
262
262
|
# @option opts [Boolean] :hyphen true 郵便番号をハイフンありで出力 false 郵便番号をハイフン無しで出力
|
263
|
-
# @return [Hash] :zip => 郵便番号, :kanji_t => 都道府県漢字, :kanji => 漢字 , :kana_t => 都道府県カナ , :kana =>
|
263
|
+
# @return [Hash] :zip => 郵便番号, :kanji_t => 都道府県漢字, :kanji => 漢字 , :kana_t => 都道府県カナ , :kana => カナ, :todofuken_code => 都道府県コード
|
264
264
|
def self.address(opts = {hyphen: false} )
|
265
265
|
table = 'addresslist'
|
266
266
|
Sequel.connect(@db_connect) do |db|
|
@@ -272,6 +272,13 @@ module Randwordjp
|
|
272
272
|
if opts[:hyphen]
|
273
273
|
@address_data[:zip]= @address_data[:zip][0,3] + "-" + @address_data[:zip][3,4]
|
274
274
|
end
|
275
|
+
todofuken_list = YAML.load_file(@yamlfile)['worddata']['todofuken_list']
|
276
|
+
todofuken_list.each_index do |i|
|
277
|
+
if todofuken_list[i] == @address_data[:kanji_t]
|
278
|
+
@address_data[:todofuken_code] = format('%02d', (i + 1))
|
279
|
+
end
|
280
|
+
end
|
281
|
+
|
275
282
|
return @address_data
|
276
283
|
end
|
277
284
|
end
|
data/lib/randwordjp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: randwordjp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- inpwjp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|