HyakuninIssyu 0.0.2 → 0.1.0

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: b047457b9efaec904d09f6cef2c5e6b2d04c259b
4
- data.tar.gz: 45265de80f9022d9554afc573167f7f0bc86ce37
3
+ metadata.gz: de7a75f3443ac869a3fefbe03b3434cd991dde33
4
+ data.tar.gz: f91bf8da91999273c46827db8d7c63bd78803728
5
5
  SHA512:
6
- metadata.gz: d746700387d53f5ea1e83742b8ef19a1c335d808e918b7cace2043be4f700e3bc3a3a1872820b597f075d3e7fc4dc1c207b0952a892088eb003a50c3bf92a59c
7
- data.tar.gz: 95d02ff80552d9aa2155c0c94ca6262847a419a09700f5b99b34fc23364e40c3a8d62593717b55c73a062ee5b419e47f1c973e3cdc52bedeb59feaee251c9cb9
6
+ metadata.gz: 52f334795d3bb5d152f5aaa772282c512f07a62a32c64dd820aaa568282e7ed85c2ec18d45c94498118fdef2f5093f9a69427fd2b442cd3a4de2db2a97a350c3
7
+ data.tar.gz: a3f0d9b97a8b26bf02af9ef392f16be48f0e026748caf31c999428cfec0021ae742365f16380ef3d66f9027dd543846e1e7eb5777471948ad5f986789670a7da
data/lib/HyakuninIssyu.rb CHANGED
@@ -2,10 +2,55 @@ require "HyakuninIssyu/version"
2
2
  require "yaml"
3
3
 
4
4
  module HyakuninIssyu
5
- AUTHORS = YAML.load_file(File.expand_path(File.join('..', 'data', 'authors.yml'), __FILE__))
6
- POEMS = YAML.load_file(File.expand_path(File.join('..', 'data', 'poems.yml'), __FILE__))
5
+ class Poem
6
+ def initialize(id)
7
+ poems = YAML.load_file(File.expand_path(File.join('..', 'data', 'poems.yml'), __FILE__))
8
+ @poem = poems[id-1]
9
+ end
7
10
 
8
- def poem(id)
11
+ def full
12
+ @poem["poem"]
13
+ end
14
+
15
+ def first
16
+ poem_data = @poem["poem"].split(" ")
17
+ first = ''
18
+ for i in 0..2
19
+ first << poem_data[i]
20
+ end
21
+ return first
22
+ end
23
+
24
+ def last
25
+ poem_data = @poem["poem"].split(" ")
26
+ first = ''
27
+ for i in 3..4
28
+ first << poem_data[i]
29
+ end
30
+ return first
31
+ end
32
+
33
+ def comment
34
+ @poem['comment']
35
+ end
36
+ end
37
+
38
+ class Poet
39
+ def initialize(id)
40
+ poets = YAML.load_file(File.expand_path(File.join('..', 'data', 'poets.yml'), __FILE__))
41
+ @poet = poets[id-1]
42
+ end
43
+
44
+ def name
45
+ @poet['name']
46
+ end
47
+
48
+ def period
49
+ @poet['period']
50
+ end
51
+
52
+ def info
53
+ @poet['info']
54
+ end
9
55
  end
10
- module_function :poem
11
56
  end
@@ -1,3 +1,3 @@
1
1
  module HyakuninIssyu
2
- VERSION = "0.0.2"
2
+ VERSION = "0.1.0"
3
3
  end
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: HyakuninIssyu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - tomomichi
@@ -53,8 +53,8 @@ files:
53
53
  - Rakefile
54
54
  - lib/HyakuninIssyu.rb
55
55
  - lib/HyakuninIssyu/version.rb
56
- - lib/data/authors.yml
57
56
  - lib/data/poems.yml
57
+ - lib/data/poets.yml
58
58
  homepage: https://github.com/Tomomichi/HyakuninIssyu
59
59
  licenses:
60
60
  - MIT