Sha256: 1f0fc25fb8f2b23df0d1c931822ab45fb9c6d050da840ca028033657017121ba
Contents?: true
Size: 620 Bytes
Versions: 13
Compression:
Stored size: 620 Bytes
Contents
module ThreeScaleToolbox module CLI class CustomTablePrinter attr_reader :fields def initialize(fields) @fields = fields end def print_record(record) print_collection([record]) end def print_collection(collection) print_header print_data(collection) end private def print_header puts fields.map(&:upcase).join("\t") end def print_data(collection) collection.each do |obj| puts fields.map { |field| obj.fetch(field, '(empty)').to_s }.join("\t") end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems