Class: Delayed::Web::StatusDecorator

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
app/decorators/delayed/web/status_decorator.rb

Instance Method Summary collapse

Instance Method Details

#can_destroy?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'app/decorators/delayed/web/status_decorator.rb', line 15

def can_destroy?
  status != 'executing'
end

#can_queue?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'app/decorators/delayed/web/status_decorator.rb', line 19

def can_queue?
  status != 'executing'
end

#statusObject



4
5
6
7
8
9
10
11
12
13
# File 'app/decorators/delayed/web/status_decorator.rb', line 4

def status
  case
  when failed_at
    'failed'
  when locked_at && locked_by
    'executing'
  else
    'queued'
  end
end