Class: Time

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.num_from_day(day) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/backup/extensions.rb', line 6

def self.num_from_day(day)
  days = { :sun => 0,
           :mon => 1,
           :tue => 2,
           :wed => 3,
           :thu => 4,
           :fri => 5,
           :sat => 6}
  days[day]
end

Instance Method Details

#days_since_epochObject



2
3
4
# File 'lib/backup/extensions.rb', line 2

def days_since_epoch
  self.to_i / 60 / 60 / 24
end