Class: TimeBuffer::Tracker

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

Instance Method Summary collapse

Constructor Details

#initializeTracker

Returns a new instance of Tracker.



15
16
17
# File 'lib/time_buffer.rb', line 15

def initialize
  @state_detector = StateDetector.new
end

Instance Method Details

#startObject



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/time_buffer.rb', line 19

def start
  loop do
    now = Time.now

    if state_detector.app_changed?
      handle_app_change(state_detector.current_app_data, now)
    elsif state_detector.
      (state_detector.current_app_data, now)
    end

    sleep 1
  end
end