Method: CacheRules#combine

Defined in:
lib/formatting.rb

#combineObject

Combine headers with a comma if the field-names are duplicate



39
40
41
42
43
44
45
46
# File 'lib/formatting.rb', line 39

def combine
  ->(headers) {
    Array(headers).group_by {|h, _| h }.map {|k, v|
      v = HEADERS_CSV.include?(k) ? v.map {|_, x| x }.join(', ') : v[0][1] # OPTIMIZE
      [ k, v ]
    }
  }
end