Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/vault-tools/time.rb

Instance Method Summary collapse

Instance Method Details

#last_monthObject



2
3
4
# File 'lib/vault-tools/time.rb', line 2

def last_month
  (self.to_datetime << 1).to_time
end

#next_monthObject



6
7
8
# File 'lib/vault-tools/time.rb', line 6

def next_month
  (self.to_datetime >> 1).to_time
end

#tomorrowObject



10
11
12
# File 'lib/vault-tools/time.rb', line 10

def tomorrow
  (self.to_datetime + 1).to_time
end

#yesterdayObject



14
15
16
# File 'lib/vault-tools/time.rb', line 14

def yesterday
  (self.to_datetime - 1).to_time
end