Class: ChhMoretext::Moretext

Inherits:
Base
  • Object
show all
Defined in:
lib/chh_moretext/moretext.rb

Class Method Summary collapse

Methods included from Request

#fetch_moretext

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