Module: Faker::QuoteTime

Extended by:
QuoteTime, ModuleUtils
Included in:
QuoteTime
Defined in:
lib/ffaker/quote_time.rb

Constant Summary collapse

ADVENTURE_QUOTES =
k [
  "That guy must do mad squats.",
  "Ticket to the gun show.",
  "Making bacon pancakes.",
  "Daddy why did you eat my fries.",
  "Sometimes you need to go where everybody knows your name.",
  "I need to save you, but who's going to save me.",
  "This magic keeps me alive, but it's driving me crazy.",
  "You are-are-are-are my best friends in the world.",
  "In my world pillows are used for bedding.",
  "You slayed the dragon with your sharp pillow."
]

Instance Method Summary collapse

Instance Method Details

#paragraph(sentence_count = 3) ⇒ Object



15
16
17
18
# File 'lib/ffaker/quote_time.rb', line 15

def paragraph(sentence_count = 3)
  sentences_with_duplicates = (1..sentence_count+10).map { sentence }
  sentences_with_duplicates.uniq[1..sentence_count+rand(4)].join(' ')
end

#paragraphs(num = 3) ⇒ Object



20
21
22
23
# File 'lib/ffaker/quote_time.rb', line 20

def paragraphs(num = 3)
  paragraphs_with_duplicates = (1..num+10).map { paragraph }
  paragraphs_with_duplicates.uniq[1..num]
end

#sentenceObject



6
7
8
# File 'lib/ffaker/quote_time.rb', line 6

def sentence
  ADVENTURE_QUOTES.sample
end

#sentences(num = 3) ⇒ Object



10
11
12
13
# File 'lib/ffaker/quote_time.rb', line 10

def sentences(num = 3)
  sentences_with_duplicates = (1..num+10).map { sentence }
  sentences_with_duplicates.uniq[1..num]
end