Sha256: 23b4ecb3eff9a6c030a86e614673ada1828c90ee9ab0b2c8d0b7a0a5ffb625a9
Contents?: true
Size: 737 Bytes
Versions: 15
Compression:
Stored size: 737 Bytes
Contents
class Dorsale::Flyboy::Task::Snoozer < ::Dorsale::Service attr_reader :task def initialize(task) @task = task end def call snooze end def snooze if task.term task.term = task.term + snooze_term_value end if task.reminder_type == "custom" task.reminder_date = task.reminder_date + snooze_reminder_value end return task.save end def snoozable? if task.done? false elsif task.reminder_date task.reminder_date <= current_date elsif task.term task.term <= current_date else false end end private def current_date Date.current end def snooze_term_value 1.week end def snooze_reminder_value 1.week end end
Version data entries
15 entries across 15 versions & 1 rubygems