Class: ChhMoretext::Moretext
Class Method Summary collapse
- .paragraph(sentence_count = 3) ⇒ Object
- .paragraphs(paragraph_count = 3) ⇒ Object
- .sentence(sentence_length_range = nil) ⇒ Object
- .sentences(sentence_count = 1, sentence_length_range = nil) ⇒ Object
Methods included from Request
Class Method Details
.paragraph(sentence_count = 3) ⇒ Object
12 13 14 |
# File 'lib/chh_moretext/moretext.rb', line 12 def paragraph(sentence_count = 3) sentences(sentence_count) end |
.paragraphs(paragraph_count = 3) ⇒ Object
16 17 18 19 20 |
# File 'lib/chh_moretext/moretext.rb', line 16 def paragraphs(paragraph_count = 3) [].tap { |paragraphs| paragraph_count.times { paragraphs << paragraph } }.join("\r\n\r\n") end |
.sentence(sentence_length_range = nil) ⇒ Object
4 5 6 |
# File 'lib/chh_moretext/moretext.rb', line 4 def sentence(sentence_length_range = nil) fetch_moretext(1, sentence_length_range)[0] end |
.sentences(sentence_count = 1, sentence_length_range = nil) ⇒ Object
8 9 10 |
# File 'lib/chh_moretext/moretext.rb', line 8 def sentences(sentence_count = 1, sentence_length_range = nil) fetch_moretext(sentence_count, sentence_length_range).join("") end |