Sha256: d31a35072381df6a60e5d5cff5cb5cee2c40a83c783ce620be75b6f938009e31
Contents?: true
Size: 788 Bytes
Versions: 5
Compression:
Stored size: 788 Bytes
Contents
class Dorsale::Flyboy::Task::Snoozer < ::Dorsale::Service attr_reader :task def initialize(task) super() @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 # rubocop:disable Lint/DuplicateBranch 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
5 entries across 5 versions & 1 rubygems