Class: TrelloCli::Formatters::CardList

Inherits:
Base
  • Object
show all
Defined in:
lib/trello_cli/formatters/card_list.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, #output, #to_json

Constructor Details

This class inherits a constructor from TrelloCli::Formatters::Base

Instance Method Details

#to_legacyObject



4
5
6
7
8
9
10
# File 'lib/trello_cli/formatters/card_list.rb', line 4

def to_legacy
  data.map do |d|
    msg = "| Name: #{d[:name]} ( #{d[:id]} )\n"
    msg << "| Description: #{d[:desc]}\n" if d[:desc]
    msg << "|------------------------\n"
  end
end

#to_tsvObject



12
13
14
15
16
# File 'lib/trello_cli/formatters/card_list.rb', line 12

def to_tsv
  data.map do |d|
    [d[:id], d[:name], d[:desc]].join("\t") + "\n"
  end
end