Class: HyakuninIssyu
- Inherits:
-
Object
- Object
- HyakuninIssyu
- Defined in:
- lib/HyakuninIssyu.rb,
lib/HyakuninIssyu/version.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
"0.8.1"
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ HyakuninIssyu
constructor
A new instance of HyakuninIssyu.
- #poem(id = nil) ⇒ Object
- #poems ⇒ Object
- #poet(id = nil) ⇒ Object
- #poets ⇒ Object
Constructor Details
#initialize ⇒ HyakuninIssyu
Returns a new instance of HyakuninIssyu.
4 5 6 7 |
# File 'lib/HyakuninIssyu.rb', line 4 def initialize @@poems = YAML.load_file(File.(File.join('..', '..', 'config', 'poems.yml'), __FILE__)) @@poets = YAML.load_file(File.(File.join('..', '..', 'config', 'poets.yml'), __FILE__)) end |
Class Method Details
.img_path ⇒ Object
9 10 11 |
# File 'lib/HyakuninIssyu.rb', line 9 def self.img_path File.("../../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 |
#poems ⇒ Object
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 |