class Time4Break
Public Class Methods
need_some_rest?()
click to toggle source
# File lib/t4b.rb, line 13 def self.need_some_rest? working_time > 3600 end
t4b()
click to toggle source
# File lib/t4b.rb, line 17 def self.t4b return "Please, leave your laptop alone for at least 5 minutes!" if need_some_rest? "Carry on working" end
woken()
click to toggle source
# File lib/t4b.rb, line 5 def self.woken `echo $(sysctl -a | grep waketime)`.split[-2] end
working_time()
click to toggle source
# File lib/t4b.rb, line 9 def self.working_time (Time.now - Time.parse(woken)).abs end