Class: Pls::Reporter

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

Overview

Formats and prints output data.

Instance Method Summary collapse

Constructor Details

#initializeReporter

Returns a new instance of Reporter.



10
11
12
# File 'lib/pls/reporter.rb', line 10

def initialize
  @beg = Time.now.to_i
end

Instance Method Details

#do(dat) ⇒ Object



22
23
24
25
# File 'lib/pls/reporter.rb', line 22

def do(dat)
  out(dat, 0)
  puts "Done in #{Time.now.to_i - @beg} seconds."
end

#out(pac, del) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/pls/reporter.rb', line 14

def out(pac, del)
  key = pac.keys[0]
  del.times { print ' ' }
  print key
  puts "\n"
  pac[key].each { |sub| out(sub, del + 2) }
end