Sha256: 7e38d43da2d899d1888c3dc260f8cda64957e77a8ddb1302b54b352e2149f575
Contents?: true
Size: 730 Bytes
Versions: 11
Compression:
Stored size: 730 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 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
11 entries across 11 versions & 1 rubygems