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.



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

def initialize
  @beg = Time.now.to_i
end

Instance Method Details

#do(dat) ⇒ Object



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

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

#out(pac, del) ⇒ Object



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

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