Class: TM::Format::Table

Inherits:
Object
  • Object
show all
Includes:
TM::Format
Defined in:
lib/tm/format/table.rb

Constant Summary

Constants included from TM::Format

COMMENT_KEYS, PROJECT_KEYS, TICKET_KEYS

Instance Method Summary collapse

Methods included from TM::Format

#normalize_entity

Instance Method Details

#afterObject



17
18
19
# File 'lib/tm/format/table.rb', line 17

def after
  puts @@table.to_s
end

#before(entity = {}) ⇒ Object



8
9
10
11
# File 'lib/tm/format/table.rb', line 8

def before(entity = {})
  @@table = Terminal::Table.new :headings => normalize_entity(entity).keys
  @@table.align_column(0, :right)
end

#format(entity) ⇒ Object



13
14
15
# File 'lib/tm/format/table.rb', line 13

def format(entity)
  @@table << normalize_entity(entity).values
end