class HammerCLI::Output::Adapter::Table

Public Instance Methods

features() click to toggle source
# File lib/hammer_cli/output/adapter/table.rb, line 5
def features
  return %i[rich_text serialized inline] if tags.empty?

  tags.map { |t| HammerCLI::Output::Utils.tag_to_feature(t) }
end
print_collection(all_fields, collection) click to toggle source
print_record(fields, record) click to toggle source

Protected Instance Methods

classes_filter() click to toggle source
# File lib/hammer_cli/output/adapter/table.rb, line 42
def classes_filter
  super << Fields::ContainerField
end
format_values(fields, collection) click to toggle source
# File lib/hammer_cli/output/adapter/table.rb, line 46
def format_values(fields, collection)
  collection.collect do |d|
    fields.inject({}) do |row, f|
      formatter = WrapperFormatter.new(@formatters.formatter_for_type(f.class), f.parameters)
      row.update(f.label => formatter.format(data_for_field(f, d) || "").to_s)
    end
  end
end