Class: Timmy::Timer

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

Instance Method Summary collapse

Constructor Details

#initializeTimer

Returns a new instance of Timer.



3
4
5
6
7
# File 'lib/timmy/timer.rb', line 3

def initialize
  @start_time = current_time()
  @output = ""
  @meters = Meters.clone_all
end

Instance Method Details

#consume_stdinObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/timmy/timer.rb', line 9

def consume_stdin
  STDIN.each_line do |line|
    line.rstrip!

    try_start_meters(line)
    put_line(line)
    try_end_meters(line)
  end

  end_all_meters()
  finalize()
end