Method: WavefrontDisplay::Base#key_width
- Defined in:
- lib/wavefront-cli/display/base.rb
#key_width(hash = {}, pad = 2) ⇒ Integer
Give it a key-value hash, and it will return the size of the first column to use when formatting that data.
116 117 118 119 |
# File 'lib/wavefront-cli/display/base.rb', line 116 def key_width(hash = {}, pad = 2) return 0 if hash.keys.empty? hash.keys.map(&:size).max + pad end |