Class: Overnight::Timer
- Inherits:
-
Object
- Object
- Overnight::Timer
- Defined in:
- lib/overnight/timer.rb
Instance Attribute Summary collapse
-
#end_time ⇒ Object
readonly
Returns the value of attribute end_time.
-
#start_time ⇒ Object
readonly
Returns the value of attribute start_time.
Instance Method Summary collapse
Instance Attribute Details
#end_time ⇒ Object (readonly)
Returns the value of attribute end_time.
3 4 5 |
# File 'lib/overnight/timer.rb', line 3 def end_time @end_time end |
#start_time ⇒ Object (readonly)
Returns the value of attribute start_time.
3 4 5 |
# File 'lib/overnight/timer.rb', line 3 def start_time @start_time end |
Instance Method Details
#elapsed_time ⇒ Object
15 16 17 |
# File 'lib/overnight/timer.rb', line 15 def elapsed_time @end_time - @start_time end |
#start ⇒ Object
5 6 7 8 |
# File 'lib/overnight/timer.rb', line 5 def start @start_time ||= Time.now self end |
#stop ⇒ Object
10 11 12 13 |
# File 'lib/overnight/timer.rb', line 10 def stop @end_time ||= Time.now self end |