Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/clir/Array.ext.rb

Instance Method Summary collapse

Instance Method Details

#pretty_joinObject



3
4
5
6
7
8
# File 'lib/clir/Array.ext.rb', line 3

def pretty_join
  return self.first if self.count == 1
  ary = self.dup
  dernier = ary.pop
  ary.join(', ') + ' et ' + dernier.to_s
end