Sha256: a66059a39a0c68ae3630e3b14df600d37aa4896d9ad45c3b040fe670b1e2ff72

Contents?: true

Size: 460 Bytes

Versions: 3

Compression:

Stored size: 460 Bytes

Contents

module Ruboty
  module Deadline
    module Actions
      class Destroy < Ruboty::Actions::Base
        def call
          if deadline = ::Ruboty::Deadline.deadlines(message.robot)[task]
            ::Ruboty::Deadline.deadlines(message.robot).delete(task)
            message.reply(::Ruboty::Deadline.deadline_message(task, deadline))
          end
        end

        private

        def task
          message[:task]
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruboty-deadline-1.0.2 lib/ruboty/deadline/actions/destroy.rb
ruboty-deadline-1.0.1 lib/ruboty/deadline/actions/destroy.rb
ruboty-deadline-1.0.0 lib/ruboty/deadline/actions/destroy.rb