Class: TimeBuffer::Tracker
- Inherits:
-
Object
- Object
- TimeBuffer::Tracker
- Defined in:
- lib/time_buffer.rb
Instance Method Summary collapse
-
#initialize ⇒ Tracker
constructor
A new instance of Tracker.
- #start ⇒ Object
Constructor Details
#initialize ⇒ Tracker
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
#start ⇒ Object
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 |