hyakunin-issyu 0.0.8 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module HyakuninIssyu
2
- VERSION = "0.0.8"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -1,23 +1,20 @@
1
1
  #encoding: utf-8
2
2
  require 'hyakunin-issyu/version'
3
- require 'yaml'
4
- path = Dir.pwd + '/vendor/bundle/ruby/1.9.1/gems/hyakunin-issyu-0.0.8/lib/hyakunin-issyu/data.yml'
5
- @data = YAML.load_file(path)
3
+ require 'yaml'
4
+ # path = Dir.pwd + '/vendor/bundle/ruby/1.9.1/gems/hyakunin-issyu-0.0.8/lib/hyakunin-issyu/data.yml'
5
+ path = 'lib/hyakunin-issyu/data.yml'
6
+ @data_set = YAML.load_file(path)
6
7
 
7
8
  module HyakuninIssyu
8
- def self.songs(start=1,last=1)
9
- new_data = Hash.new
10
- for i in start..last do
11
- new_data[i] = @data[i]
12
- end
13
- return new_data
9
+ def initialize
10
+ HyakuninIssyu.const_set("SONGS", @data_set)
14
11
  end
15
12
 
16
- def self.poem(id=1)
17
- @data[id]['poem']
18
- end
19
-
20
- def self.poet(id=1)
21
- @data[id]['poet']
13
+ def songs(id_from, id_to)
14
+ @songs = Array.new
15
+ for i in id_from..id_to
16
+ song = HyakuninIssyu.const_get("SONGS")
17
+ @songs[i] = song[i]
18
+ end
22
19
  end
23
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyakunin-issyu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-15 00:00:00.000000000 Z
12
+ date: 2013-01-18 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: This Gem offer all the information about Hyakunin-issyu, the One Hundred
15
15
  Poems by One Hundred Poets.