Method: TimeRounder::RoundedTime#rounded_time

Defined in:
lib/time_rounder/rounded_time.rb

#rounded_timeObject

returns the DateTime/Time object on the correct quarter hour



13
14
15
16
17
18
19
# File 'lib/time_rounder/rounded_time.rb', line 13

def rounded_time
  number_to_add = magic_number
  seconds_to_remove = (time.sec + (minutes * 60))
  self.time -= seconds_to_remove
  self.time += number_to_add
  time
end