Class: ActiveSupport::TimeWithZone

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_core_extensions/time_with_zone.rb

Instance Method Summary collapse

Instance Method Details

#hours_sinceObject



11
12
13
# File 'lib/rails_core_extensions/time_with_zone.rb', line 11

def hours_since
  minutes_since/60
end

#minutes_sinceObject



7
8
9
# File 'lib/rails_core_extensions/time_with_zone.rb', line 7

def minutes_since
  seconds_since/60
end

#seconds_sinceObject



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

def seconds_since
  (Time.now - self).to_i
end