Sha256: 90913c7adabcd684d9dfa055b4977866386fca5714cefbc00a2bf65e2024f83a
Contents?: true
Size: 598 Bytes
Versions: 78
Compression:
Stored size: 598 Bytes
Contents
# encoding: utf-8 # Hash class Hash # get pipe format table string from key + value # # ==== Examples # # valid commma case # # { # :key_1 => :value1___________________, # :key__2 => :value2, # :key___3 => :value3, # }.table # # result # # |key_1 |value1___________________| # |key__2 |value2 | # |key___3|value3 | # def table ret = [keys, values].treduce([]) do |ret, one, other| ret << "|#{one}|#{other}|" ret end ret = ret.join("\n") + "\n" ret.justify_table end end
Version data entries
78 entries across 78 versions & 1 rubygems