randwordjp 0.0.18 → 0.0.19

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: 21846a80524f373da48f1f782cc8feb4f6640156
4
- data.tar.gz: 2a7afccbc037ceaa5c3569c017dbc9657186209c
3
+ metadata.gz: bb4e9fd91f84cc00696dcf03334e61d8e03440cc
4
+ data.tar.gz: e872b3b8013b8c3fe20f34fec5278e04f33a3125
5
5
  SHA512:
6
- metadata.gz: 8f3e95880b8589c18cb0ac884e17a0b3d91860d19715b359c7c8954821cddb6f1dcf59ab97f848d69c76016e938b2df9b6d7204c58292472852fc4a820958792
7
- data.tar.gz: a4c30d8f48cfe8cd76ac6ebbb8dbe1255269066b0830442a68f970336e83d6a4ddd372adae7f75f312a4f5f79a49fe6a8d76931973f3454495549de61bd3323d
6
+ metadata.gz: ad09ba6f95aea9c311d652c48af05fe7150e1f29beed427e3a7a9b01e2e18320f7222fb9b3e4dfceeedacb0e7b9e1d3f50c15063c49bb2f0b8ffa280b60d0547
7
+ data.tar.gz: 282641ad70309180088c6cdf2e15ce89856e80b52f584ad8aeacbae948e26440eacb5ad0c51be11d6b4f8bee95dac533eebf5429292cbf0d3286539f634bb37a
data/README.md CHANGED
@@ -1,8 +1,15 @@
1
1
  # Randwordjp
2
2
 
3
- TODO: Write a gem description
3
+ randwordjp is a library for outputting the data of the Japanese at random .
4
+
5
+ randowrjp output the myoji, namae , Japanese postal code, Japanese state .
6
+
7
+ randwordjpはランダムで日本語のデータを出力するためのライブラリです。
8
+
9
+ randowrjpは日本語の名前、苗字、日本の郵便番号、都道府県、などの出力を行うことができます。
4
10
 
5
11
  ## Installation
12
+ Randwordjp is require sqlite3 adapter and sequel.
6
13
 
7
14
  Add this line to your application's Gemfile:
8
15
 
@@ -18,7 +25,26 @@ Or install it yourself as:
18
25
 
19
26
  ## Usage
20
27
 
21
- Get Japanese random words.
28
+ require first.
29
+
30
+ require 'randwordjp'
31
+
32
+ get namae(first name)
33
+ 名前を取得する
34
+
35
+ Randwordjp.namae
36
+
37
+ get myoji(family name)
38
+ 苗字を取得する
39
+
40
+ Randwordjp.myoji
41
+
42
+ get zip
43
+ 郵便番号を取得する
44
+
45
+ Randwordjp.zip
46
+
47
+ For more information , please refer to the yardoc.
22
48
 
23
49
  ## Contributing
24
50
 
@@ -2,5 +2,5 @@
2
2
  # ランダムで日本語文字列などを生成するライブラリとなります。
3
3
  # can get random words(sentence).
4
4
  module Randwordjp
5
- VERSION = '0.0.18'
5
+ VERSION = '0.0.19'
6
6
  end
data/lib/randwordjp.rb CHANGED
@@ -129,12 +129,14 @@ module Randwordjp
129
129
  end
130
130
 
131
131
  # Date型の日付を取得する。
132
- # @param [Date] date 指定日
133
- # @param [Integer] before 指定日より後の最大何日までを対象とする
134
- # @param [Integer] after 指定日より前の最大何日までを対象とする
132
+ # @param [Hash] opts オプション指定
133
+ # @option opts [Date] :date 指定日
134
+ # @option opts [Integer] :before 指定日より前の最大何日までを対象とする
135
+ # @option opts [Integer] :after 指定日より後の最大何日までを対象とする
135
136
  # @return [Date] 日付を取得する
136
- def self.date(date = Date.today, before = 100, after = 100)
137
- (date + (rand(after)) - (rand(before))).to_s
137
+ def self.date(opts ={ before: 100, after: 100 ,date: Date.today} )
138
+ opts[:date] ||= Date.today
139
+ return opts[:date] + (rand(opts[:after].to_i + opts[:before].to_i) - opts[:before].to_i )
138
140
  end
139
141
 
140
142
  # String型の都道府県名を取得する
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: randwordjp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.18
4
+ version: 0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - inpwjp