Module: FFaker::CheesyLingo

Extended by:
CheesyLingo, ModuleUtils
Included in:
CheesyLingo
Defined in:
lib/ffaker/cheesy_lingo.rb

Constant Summary collapse

TITLE_1 =
%w[Sharp Soft Nutty Smokey Melting Cheeky Fat Dutch Grated Cheesed Milky].freeze
TITLE_2 =
%w[Gouda Affineurs Alpine Sheep Cows Brie Goats Coulommiers Dairy].freeze

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, luhn_check, underscore, unique

Methods included from RandomUtils

#fetch_sample, #rand, #shuffle

Instance Method Details

#paragraph(number_of_phrases = 10) ⇒ Object



33
34
35
36
37
# File 'lib/ffaker/cheesy_lingo.rb', line 33

def paragraph(number_of_phrases = 10)
  p = +fetch_sample(CHEESY_PHRASES).capitalize
  (number_of_phrases - 1).times { p << " #{fetch_sample(CHEESY_PHRASES)}" }
  p << '.'
end

#sentenceObject



25
26
27
28
29
30
31
# File 'lib/ffaker/cheesy_lingo.rb', line 25

def sentence
  "#{[
    fetch_sample(CHEESY_PHRASES).capitalize,
    fetch_sample(CHEESY_PHRASES),
    fetch_sample(CHEESY_PHRASES)
  ].join}."
end

#titleObject



13
14
15
# File 'lib/ffaker/cheesy_lingo.rb', line 13

def title
  "#{fetch_sample(TITLE_1)} #{fetch_sample(TITLE_2)}"
end

#wordObject



17
18
19
# File 'lib/ffaker/cheesy_lingo.rb', line 17

def word
  fetch_sample(CHEESY_WORDS)
end

#words(count = 5) ⇒ Object



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

def words(count = 5)
  fetch_sample(CHEESY_WORDS, count: count)
end