Class: Task

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/task.rb

Constant Summary

@@checked_attributes =
[:prototype_id,:name,:description]

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Object) element_aoi_id

Returns the value of attribute element_aoi_id



16
17
18
# File 'app/models/task.rb', line 16

def element_aoi_id
  @element_aoi_id
end

- (Object) prototype_name

Returns the value of attribute prototype_name



15
16
17
# File 'app/models/task.rb', line 15

def prototype_name
  @prototype_name
end

Instance Method Details

- (Object) attributes



22
23
24
# File 'app/models/task.rb', line 22

def attributes
  super.merge('prototype_name' => self.prototype_name, 'element_aoi_id' => self.element_aoi_id, 'task_run_count' => self.task_run_count)
end

- (Object) check_readiness



36
37
38
39
40
41
42
43
44
# File 'app/models/task.rb', line 36

def check_readiness
  self.ready = true

  @@checked_attributes.each do |attr|
    self.ready = self.ready && !self[attr].blank?
  end

  self.ready
end

- (Object) task_run_count



59
60
61
# File 'app/models/task.rb', line 59

def task_run_count
  self.task_runs.size
end

- (Object) trigger_readiness_check



26
27
28
29
30
31
32
33
34
# File 'app/models/task.rb', line 26

def trigger_readiness_check
  check_readiness

  if self.test
    self.test.check_readiness
  end

  true
end