Sequel::Model
# File lib/timetrap/models.rb, line 36 def duration @duration ||= self.end_or_now.to_i - self.start.to_i end
# File lib/timetrap/models.rb, line 39 def duration=( nd ) @duration = nd.to_i end
# File lib/timetrap/models.rb, line 20 def end= time self[:end]= Timer.process_time(time) end
# File lib/timetrap/models.rb, line 43 def end_or_now self.end || (round? ? round(Time.now) : Time.now) end
# File lib/timetrap/models.rb, line 55 def round time return nil unless time Time.at( if (r = time.to_i % Timetrap::Config['round_in_seconds']) < 450 time.to_i - r else time.to_i + (Timetrap::Config['round_in_seconds'] - r) end ) end
# File lib/timetrap/models.rb, line 12 def round? !!self.class.round end
# File lib/timetrap/models.rb, line 51 def rounded_end round(self[:end]) end
# File lib/timetrap/models.rb, line 47 def rounded_start round(self[:start]) end
# File lib/timetrap/models.rb, line 32 def sheet self[:sheet].to_s end
Generated with the Darkfish Rdoc Generator 2.