Sha256: a374ac771365c2b736b8f9ec2b9e0cc0d9a97f36e52be1517f4135daad3e4281
Contents?: true
Size: 428 Bytes
Versions: 50
Compression:
Stored size: 428 Bytes
Contents
# encoding: utf-8 # Array class Array # Convert array to list # # @return [String] # A string representation of list def to_list(separator: ', ', last_separator: separator, around: '"') items = map { |l| format("#{around}%s#{around}", l) } return items.join(last_separator) if items.size <= 2 result = items.slice(0..-2).join(separator) << last_separator result << items.last result end end
Version data entries
50 entries across 50 versions & 1 rubygems