lib/cat_ipsum.rb in cat_ipsum-0.1.0 vs lib/cat_ipsum.rb in cat_ipsum-0.1.1
- old
+ new
@@ -3,10 +3,14 @@
module CatIpsum
extend self
def sentence
- Array.new(rand(1..5), CAT_ACTIONS.sample).join(', ').capitalize
+ result = []
+ rand(1..5).times do
+ result << CAT_ACTIONS.sample
+ end
+ result.join(', ').capitalize
end
alias phrase sentence
def sentences(sentence_count = 5)