Class: Helpers::Time

Inherits:
Object
  • Object
show all
Defined in:
lib/prosperity/helpers/time.rb

Class Method Summary collapse

Class Method Details

.beginning_of_hour(date) ⇒ Object



3
4
5
# File 'lib/prosperity/helpers/time.rb', line 3

def self.beginning_of_hour(date)
  DateTime.new(date.year, date.month, date.day, date.hour)
end

.end_of_hour(date) ⇒ Object



7
8
9
# File 'lib/prosperity/helpers/time.rb', line 7

def self.end_of_hour(date)
  DateTime.new(date.year, date.month, date.day, date.hour) + 1.hour
end