Class: ItemsPrinter

Inherits:
Object
  • Object
show all
Defined in:
lib/itemsPrinter.rb

Instance Method Summary collapse

Constructor Details

#initialize(items) ⇒ ItemsPrinter

Returns a new instance of ItemsPrinter.



5
6
7
# File 'lib/itemsPrinter.rb', line 5

def initialize(items)
  @items = items
end

Instance Method Details

#printItemsObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/itemsPrinter.rb', line 9

def printItems
  puts ''
  puts '==========='
  puts ' Items '
  puts '-----------'
  puts 'status | title'
  for item in @items
    given_title = item.getGivenTitle
    status = item.getStatus
    tags = item.getTags
    if !tags.empty?
      puts "#{status} | #{tags} #{given_title}"
    else
      puts "#{status} | #{given_title}"
    end
  end
  puts '==========='
  puts ''
end