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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d91db7641cb11b3cf04de5baee25c1a1dc8f9bf0
4
- data.tar.gz: d2e2102b8cddbb78b18fb7f8f9462dfed4361e19
3
+ metadata.gz: 9018f82c6e18a622fb6056fefdb00ff71b27a316
4
+ data.tar.gz: 38213fd2e887596f742c8f28b651417907f3bb02
5
5
  SHA512:
6
- metadata.gz: 82082495915046ad72334465ca4c9fab882883dc213c48341f3fb45e97ffcb2540730a2143a9b932d501ad81cc5eb8e34936cf9942d40b04f8866a9dafe96a09
7
- data.tar.gz: 66fc857159c28578f1070cf1ec909376e47b1f1096dc31b06e016628452d75ec8eafbe83e326f6c81743b5e7da1e7d735ba5c97a4c9f5ff6b2a7e59ed9362785
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
@@ -2,5 +2,5 @@
2
2
  # ランダムで日本語文字列などを生成するライブラリとなります。
3
3
  # can get random words(sentence).
4
4
  module Randwordjp
5
- VERSION = '0.1.3'
5
+ VERSION = '0.1.4'
6
6
  end
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.3
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-17 00:00:00.000000000 Z
11
+ date: 2015-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel