Module: Timer

Included in:
DB, Report
Defined in:
lib/timer.rb

Instance Method Summary collapse

Instance Method Details

#last_monObject



7
8
9
10
# File 'lib/timer.rb', line 7

def last_mon
  mon = Time.at(now - (Time.at(now).wday - 1) * 24 * 60 * 60)
  Time.new(mon.year, mon.month, mon.day).to_i
end

#nowObject



3
4
5
# File 'lib/timer.rb', line 3

def now
  time = ENV['POTAM'] == 'test' ? ENV['POTAMTIME'].to_i : Time.now.to_i
end