lib/cat_ipsum.rb in cat_ipsum-0.1.1 vs lib/cat_ipsum.rb in cat_ipsum-0.2.1
- old
+ new
@@ -1,16 +1,13 @@
require 'cat_ipsum/version'
require 'cat_ipsum/cat_actions'
+require 'cat_ipsum/random'
module CatIpsum
extend self
def sentence
- result = []
- rand(1..5).times do
- result << CAT_ACTIONS.sample
- end
- result.join(', ').capitalize
+ Random.sample(CAT_ACTIONS.dup).join(', ').capitalize
end
alias phrase sentence
def sentences(sentence_count = 5)