Class: Lorem
- Inherits:
-
Object
- Object
- Lorem
- Defined in:
- lib/lorem_wdipsum.rb
Class Method Summary collapse
Class Method Details
.paragraph(length) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/lorem_wdipsum.rb', line 17 def self.paragraph(length) length.times do sentence = word(8) puts sentence end end |
.put_word ⇒ Object
5 6 7 |
# File 'lib/lorem_wdipsum.rb', line 5 def self.put_word word = @words.sample end |
.word(length) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/lorem_wdipsum.rb', line 9 def self.word(length) if length <= @words.length length.times do puts put_word end end end |