module FFaker::LoremPL

Inspirations: pl.wiktionary.org

Public Instance Methods

character() click to toggle source
# File lib/ffaker/lorem_pl.rb, line 10
def character
  fetch_sample(CHARACTERS)
end
characters(count = 10) click to toggle source
# File lib/ffaker/lorem_pl.rb, line 14
def characters(count = 10)
  fetch_sample(CHARACTERS, count: count).join
end
paragraph(count = 3) click to toggle source
# File lib/ffaker/lorem_pl.rb, line 42
def paragraph(count = 3)
  sentences(count + rand(0..2)).join(' ')
end
paragraphs(count = 3) click to toggle source
# File lib/ffaker/lorem_pl.rb, line 46
def paragraphs(count = 3)
  (1..count).map { paragraph }
end
phrase(count = 7)
Alias for: sentence
phrases(count = 3)
Alias for: sentences
sentence(count = 7) click to toggle source
# File lib/ffaker/lorem_pl.rb, line 26
def sentence(count = 7)
  sentence = words(count + rand(0..5))
  sentence[rand(3..(sentence.length - 3))] += ',' if sentence.length > 10
  sentence = sentence.join(' ')
  sentence = sentence.capitalize
  "#{sentence}#{end_of_sentence}"
end
Also aliased as: phrase
sentences(count = 3) click to toggle source
# File lib/ffaker/lorem_pl.rb, line 36
def sentences(count = 3)
  (1..count).map { sentence }
end
Also aliased as: phrases
word() click to toggle source
# File lib/ffaker/lorem_pl.rb, line 18
def word
  fetch_sample(WORDS)
end
words(count = 3) click to toggle source
# File lib/ffaker/lorem_pl.rb, line 22
def words(count = 3)
  fetch_sample(WORDS, count: count)
end

Private Instance Methods

end_of_sentence() click to toggle source
# File lib/ffaker/lorem_pl.rb, line 52
def end_of_sentence
  case rand(10)
  when 0..7 then '.'
  when 8 then '?'
  when 9 then '!'
  end
end