Sha256: b62a990267a047542f5e158b842b323f53c41af413b73ddc1939f949b17cbddd

Contents?: true

Size: 400 Bytes

Versions: 10

Compression:

Stored size: 400 Bytes

Contents

module Delayed
  module Web
    class StatusDecorator < SimpleDelegator
      def status
        case
        when failed_at
          'failed'
        when locked_at && locked_by
          'executing'
        else
          'queued'
        end
      end

      def can_destroy?
        status != 'executing'
      end

      def can_queue?
        status != 'executing'
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
delayed-web-0.4.9 app/decorators/delayed/web/status_decorator.rb
delayed-web-0.4.7 app/decorators/delayed/web/status_decorator.rb
delayed-web-0.4.6 app/decorators/delayed/web/status_decorator.rb
delayed-web-0.4.5 app/decorators/delayed/web/status_decorator.rb
delayed-web-0.4.4 app/decorators/delayed/web/status_decorator.rb
delayed-web-0.4.3 app/decorators/delayed/web/status_decorator.rb
delayed-web-0.4.2 app/decorators/delayed/web/status_decorator.rb
delayed-web-0.4.1 app/decorators/delayed/web/status_decorator.rb
delayed-web-0.4.0 app/decorators/delayed/web/status_decorator.rb
delayed-web-0.3.0 app/decorators/delayed/web/status_decorator.rb