# File lib/active_support/core_ext/array/conversions.rb, line 9 def to_sentence(options = {}) options.assert_valid_keys(:connector, :skip_last_comma) options.reverse_merge! :connector => 'and', :skip_last_comma => false case length when 1 self[0] when 2 "#{self[0]} #{options[:connector]} #{self[1]}" else "#{self[0...-1].join(', ')}#{options[:skip_last_comma] ? '' : ','} #{options[:connector]} #{self[-1]}" end end