Class: Timmy::Timer
- Inherits:
-
Object
- Object
- Timmy::Timer
- Defined in:
- lib/timmy/timer.rb
Instance Method Summary collapse
- #consume_stdin ⇒ Object
-
#initialize ⇒ Timer
constructor
A new instance of Timer.
Constructor Details
#initialize ⇒ Timer
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_stdin ⇒ Object
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 |