Class: HyakuninIssyu

Inherits:
Object
  • Object
show all
Defined in:
lib/HyakuninIssyu.rb,
lib/HyakuninIssyu/version.rb

Direct Known Subclasses

Poem, Poet

Defined Under Namespace

Classes: Poem, Poet

Constant Summary collapse

VERSION =
"0.8.1"

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHyakuninIssyu

Returns a new instance of HyakuninIssyu.



4
5
6
7
# File 'lib/HyakuninIssyu.rb', line 4

def initialize
	@@poems = YAML.load_file(File.expand_path(File.join('..', '..', 'config', 'poems.yml'), __FILE__))
	@@poets = YAML.load_file(File.expand_path(File.join('..', '..', 'config', 'poets.yml'), __FILE__))
end

Class Method Details

.img_pathObject



9
10
11
# File 'lib/HyakuninIssyu.rb', line 9

def self.img_path
  File.expand_path("../../assets/img", __FILE__)
end

Instance Method Details

#poem(id = nil) ⇒ Object



13
14
15
16
# File 'lib/HyakuninIssyu.rb', line 13

def poem(id=nil)
	return false if id.nil? || id<1 || id>100
	poem = Poem.new(id)
end

#poemsObject



23
24
25
26
27
28
29
# File 'lib/HyakuninIssyu.rb', line 23

def poems
	poems = Array.new
	for i in 1..100
		poems[i] = Poem.new(i)
	end
	return poems
end

#poet(id = nil) ⇒ Object



18
19
20
21
# File 'lib/HyakuninIssyu.rb', line 18

def poet(id=nil)
	return false if id.nil? || id<1 || id>100
	poet = Poet.new(id)
end

#poetsObject



31
32
33
34
35
36
37
# File 'lib/HyakuninIssyu.rb', line 31

def poets
	poets = Array.new
	for i in 1..100
		poets[i] = Poet.new(i)
	end
	return poets
end