Class: HyakuninIssyu

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

Direct Known Subclasses

Data, Poem, Poet

Defined Under Namespace

Classes: Data, Poem, Poet

Constant Summary collapse

VERSION =
"1.0.1"
@@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__))

Class Method Summary collapse

Class Method Details

.allObject



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

def self.all
	all = []
	for i in 1..100
		all << self.find(i)
	end
	all
end

.find(id = nil) ⇒ Object



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

def self.find(id=nil)
	return nil if id.nil? || id<1 || id>100
	Data.new(id)
end