Class: Toro::Job

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/toro/job.rb

Constant Summary collapse

STATUSES =
[
  'queued',
  'running',
  'complete',
  'failed',
  'scheduled'
]

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.statusesObject



22
23
24
# File 'lib/toro/job.rb', line 22

def statuses
  STATUSES
end

Instance Method Details

#set_properties(hash) ⇒ Object



27
28
29
30
31
32
# File 'lib/toro/job.rb', line 27

def set_properties(hash)
  self.properties ||= {}
  hash.each do |key, value|
    self.properties[key.to_s] = value
  end
end

#to_sObject



34
35
36
# File 'lib/toro/job.rb', line 34

def to_s
  "Toro::Job ##{id}"
end