method
to_sentence
1.3.1 -
Show latest stable
- Class:
Spec::Matchers::Pretty
to_sentence(words=[])public
No documentation available.
# File lib/spec/matchers/pretty.rb, line 8
def to_sentence(words=[])
words = words.map{|w| w.inspect}
case words.length
when 0
""
when 1
" #{words[0]}"
when 2
" #{words[0]} and #{words[1]}"
else
" #{words[0...-1].join(', ')}, and #{words[-1]}"
end
end