Class: AnalysisTask

Inherits:
ActiveRecord::Base show all
Defined in:
app/models/analysis_task.rb

Overview

An analysis task run on a dataset

While the processing is actually occurring in a delayed job, we need a way for those delayed jobs to readily communicate with users via the web front-end. This model is how they do so.

Instance Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from ActiveRecord::Base

logger

Instance Attribute Details

- (DateTime) created_at

Returns The time at which this task was started

Returns:

  • (DateTime)

    The time at which this task was started



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'app/models/analysis_task.rb', line 32

class AnalysisTask < ActiveRecord::Base
  validates :name, presence: true
  validates :dataset_id, presence: true
  validates :job_type, presence: true

  belongs_to :dataset
  has_attached_file :result, database_table: 'analysis_task_results'

  scope :finished, -> { where('finished_at IS NOT NULL') }
  scope :not_finished, -> { where('finished_at IS NULL') }
  scope :active, -> { not_finished.where(failed: false) }
  scope :failed, -> { not_finished.where(failed: true) }

  # Convert class_name to a class object
  #
  # @api public
  # @param [String] class_name the class name to convert
  # @return [Class] the job class
  # @example Call the view_path method for ExportCitations
  #   AnalysisTask.job_class('ExportCitations').view_path(...)
  def self.job_class(class_name)
    # Never let the 'Base' class match
    class_name = 'Jobs::Analysis::' + class_name
    fail ArgumentError, 'cannot instantiate the Base job' if class_name == 'Jobs::Analysis::Base'

    begin
      klass = class_name.constantize
      fail ArgumentError, "#{class_name} is not a class" unless klass.is_a?(Class)
    rescue NameError
      raise ArgumentError, "#{class_name} is not a valid class"
    end

    klass
  end

  # Convert #job_type into a class object
  #
  # @api public
  # @return [Class] the job class
  # @example Call the view_path method for this task
  #   task.job_class.view_path(...)
  def job_class
    self.class.job_class(job_type)
  end

  # Hook to be called whenever a job finishes
  #
  # This hook will set the finished attribute on the job and send a
  # notification e-mail to the user.
  #
  # @api private
  # @return [undefined]
  def finish!
    # Make sure the task is saved, setting 'finished_at'
    self.finished_at = DateTime.current
    save

    # Send the user an e-mail
    UserMailer.job_finished_email(dataset.user.email, to_param).deliver
  end
end

- (Dataset) dataset

Returns The dataset to which this task belongs (belongs_to)

Returns:

  • (Dataset)

    The dataset to which this task belongs (belongs_to)

Raises:

  • (RecordInvalid)

    if the dataset is missing (validates :presence)



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'app/models/analysis_task.rb', line 32

class AnalysisTask < ActiveRecord::Base
  validates :name, presence: true
  validates :dataset_id, presence: true
  validates :job_type, presence: true

  belongs_to :dataset
  has_attached_file :result, database_table: 'analysis_task_results'

  scope :finished, -> { where('finished_at IS NOT NULL') }
  scope :not_finished, -> { where('finished_at IS NULL') }
  scope :active, -> { not_finished.where(failed: false) }
  scope :failed, -> { not_finished.where(failed: true) }

  # Convert class_name to a class object
  #
  # @api public
  # @param [String] class_name the class name to convert
  # @return [Class] the job class
  # @example Call the view_path method for ExportCitations
  #   AnalysisTask.job_class('ExportCitations').view_path(...)
  def self.job_class(class_name)
    # Never let the 'Base' class match
    class_name = 'Jobs::Analysis::' + class_name
    fail ArgumentError, 'cannot instantiate the Base job' if class_name == 'Jobs::Analysis::Base'

    begin
      klass = class_name.constantize
      fail ArgumentError, "#{class_name} is not a class" unless klass.is_a?(Class)
    rescue NameError
      raise ArgumentError, "#{class_name} is not a valid class"
    end

    klass
  end

  # Convert #job_type into a class object
  #
  # @api public
  # @return [Class] the job class
  # @example Call the view_path method for this task
  #   task.job_class.view_path(...)
  def job_class
    self.class.job_class(job_type)
  end

  # Hook to be called whenever a job finishes
  #
  # This hook will set the finished attribute on the job and send a
  # notification e-mail to the user.
  #
  # @api private
  # @return [undefined]
  def finish!
    # Make sure the task is saved, setting 'finished_at'
    self.finished_at = DateTime.current
    save

    # Send the user an e-mail
    UserMailer.job_finished_email(dataset.user.email, to_param).deliver
  end
end

- (Boolean) failed

Returns True if this job has failed

Returns:

  • (Boolean)

    True if this job has failed



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'app/models/analysis_task.rb', line 32

class AnalysisTask < ActiveRecord::Base
  validates :name, presence: true
  validates :dataset_id, presence: true
  validates :job_type, presence: true

  belongs_to :dataset
  has_attached_file :result, database_table: 'analysis_task_results'

  scope :finished, -> { where('finished_at IS NOT NULL') }
  scope :not_finished, -> { where('finished_at IS NULL') }
  scope :active, -> { not_finished.where(failed: false) }
  scope :failed, -> { not_finished.where(failed: true) }

  # Convert class_name to a class object
  #
  # @api public
  # @param [String] class_name the class name to convert
  # @return [Class] the job class
  # @example Call the view_path method for ExportCitations
  #   AnalysisTask.job_class('ExportCitations').view_path(...)
  def self.job_class(class_name)
    # Never let the 'Base' class match
    class_name = 'Jobs::Analysis::' + class_name
    fail ArgumentError, 'cannot instantiate the Base job' if class_name == 'Jobs::Analysis::Base'

    begin
      klass = class_name.constantize
      fail ArgumentError, "#{class_name} is not a class" unless klass.is_a?(Class)
    rescue NameError
      raise ArgumentError, "#{class_name} is not a valid class"
    end

    klass
  end

  # Convert #job_type into a class object
  #
  # @api public
  # @return [Class] the job class
  # @example Call the view_path method for this task
  #   task.job_class.view_path(...)
  def job_class
    self.class.job_class(job_type)
  end

  # Hook to be called whenever a job finishes
  #
  # This hook will set the finished attribute on the job and send a
  # notification e-mail to the user.
  #
  # @api private
  # @return [undefined]
  def finish!
    # Make sure the task is saved, setting 'finished_at'
    self.finished_at = DateTime.current
    save

    # Send the user an e-mail
    UserMailer.job_finished_email(dataset.user.email, to_param).deliver
  end
end

- (DateTime) finished_at

Returns The time at which this task was finished

Returns:

  • (DateTime)

    The time at which this task was finished



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'app/models/analysis_task.rb', line 32

class AnalysisTask < ActiveRecord::Base
  validates :name, presence: true
  validates :dataset_id, presence: true
  validates :job_type, presence: true

  belongs_to :dataset
  has_attached_file :result, database_table: 'analysis_task_results'

  scope :finished, -> { where('finished_at IS NOT NULL') }
  scope :not_finished, -> { where('finished_at IS NULL') }
  scope :active, -> { not_finished.where(failed: false) }
  scope :failed, -> { not_finished.where(failed: true) }

  # Convert class_name to a class object
  #
  # @api public
  # @param [String] class_name the class name to convert
  # @return [Class] the job class
  # @example Call the view_path method for ExportCitations
  #   AnalysisTask.job_class('ExportCitations').view_path(...)
  def self.job_class(class_name)
    # Never let the 'Base' class match
    class_name = 'Jobs::Analysis::' + class_name
    fail ArgumentError, 'cannot instantiate the Base job' if class_name == 'Jobs::Analysis::Base'

    begin
      klass = class_name.constantize
      fail ArgumentError, "#{class_name} is not a class" unless klass.is_a?(Class)
    rescue NameError
      raise ArgumentError, "#{class_name} is not a valid class"
    end

    klass
  end

  # Convert #job_type into a class object
  #
  # @api public
  # @return [Class] the job class
  # @example Call the view_path method for this task
  #   task.job_class.view_path(...)
  def job_class
    self.class.job_class(job_type)
  end

  # Hook to be called whenever a job finishes
  #
  # This hook will set the finished attribute on the job and send a
  # notification e-mail to the user.
  #
  # @api private
  # @return [undefined]
  def finish!
    # Make sure the task is saved, setting 'finished_at'
    self.finished_at = DateTime.current
    save

    # Send the user an e-mail
    UserMailer.job_finished_email(dataset.user.email, to_param).deliver
  end
end

- (String) job_type

Returns The class name of the job this task contains

Returns:

  • (String)

    The class name of the job this task contains

Raises:

  • (RecordInvalid)

    if the job type is missing (validates :presence)



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'app/models/analysis_task.rb', line 32

class AnalysisTask < ActiveRecord::Base
  validates :name, presence: true
  validates :dataset_id, presence: true
  validates :job_type, presence: true

  belongs_to :dataset
  has_attached_file :result, database_table: 'analysis_task_results'

  scope :finished, -> { where('finished_at IS NOT NULL') }
  scope :not_finished, -> { where('finished_at IS NULL') }
  scope :active, -> { not_finished.where(failed: false) }
  scope :failed, -> { not_finished.where(failed: true) }

  # Convert class_name to a class object
  #
  # @api public
  # @param [String] class_name the class name to convert
  # @return [Class] the job class
  # @example Call the view_path method for ExportCitations
  #   AnalysisTask.job_class('ExportCitations').view_path(...)
  def self.job_class(class_name)
    # Never let the 'Base' class match
    class_name = 'Jobs::Analysis::' + class_name
    fail ArgumentError, 'cannot instantiate the Base job' if class_name == 'Jobs::Analysis::Base'

    begin
      klass = class_name.constantize
      fail ArgumentError, "#{class_name} is not a class" unless klass.is_a?(Class)
    rescue NameError
      raise ArgumentError, "#{class_name} is not a valid class"
    end

    klass
  end

  # Convert #job_type into a class object
  #
  # @api public
  # @return [Class] the job class
  # @example Call the view_path method for this task
  #   task.job_class.view_path(...)
  def job_class
    self.class.job_class(job_type)
  end

  # Hook to be called whenever a job finishes
  #
  # This hook will set the finished attribute on the job and send a
  # notification e-mail to the user.
  #
  # @api private
  # @return [undefined]
  def finish!
    # Make sure the task is saved, setting 'finished_at'
    self.finished_at = DateTime.current
    save

    # Send the user an e-mail
    UserMailer.job_finished_email(dataset.user.email, to_param).deliver
  end
end

- (String) name

Returns The name of this task

Returns:

  • (String)

    The name of this task

Raises:

  • (RecordInvalid)

    if the name is missing (validates :presence)



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'app/models/analysis_task.rb', line 32

class AnalysisTask < ActiveRecord::Base
  validates :name, presence: true
  validates :dataset_id, presence: true
  validates :job_type, presence: true

  belongs_to :dataset
  has_attached_file :result, database_table: 'analysis_task_results'

  scope :finished, -> { where('finished_at IS NOT NULL') }
  scope :not_finished, -> { where('finished_at IS NULL') }
  scope :active, -> { not_finished.where(failed: false) }
  scope :failed, -> { not_finished.where(failed: true) }

  # Convert class_name to a class object
  #
  # @api public
  # @param [String] class_name the class name to convert
  # @return [Class] the job class
  # @example Call the view_path method for ExportCitations
  #   AnalysisTask.job_class('ExportCitations').view_path(...)
  def self.job_class(class_name)
    # Never let the 'Base' class match
    class_name = 'Jobs::Analysis::' + class_name
    fail ArgumentError, 'cannot instantiate the Base job' if class_name == 'Jobs::Analysis::Base'

    begin
      klass = class_name.constantize
      fail ArgumentError, "#{class_name} is not a class" unless klass.is_a?(Class)
    rescue NameError
      raise ArgumentError, "#{class_name} is not a valid class"
    end

    klass
  end

  # Convert #job_type into a class object
  #
  # @api public
  # @return [Class] the job class
  # @example Call the view_path method for this task
  #   task.job_class.view_path(...)
  def job_class
    self.class.job_class(job_type)
  end

  # Hook to be called whenever a job finishes
  #
  # This hook will set the finished attribute on the job and send a
  # notification e-mail to the user.
  #
  # @api private
  # @return [undefined]
  def finish!
    # Make sure the task is saved, setting 'finished_at'
    self.finished_at = DateTime.current
    save

    # Send the user an e-mail
    UserMailer.job_finished_email(dataset.user.email, to_param).deliver
  end
end

- (String) result_content_type

Returns The content type of the result file (from Paperclip)

Returns:

  • (String)

    The content type of the result file (from Paperclip)



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'app/models/analysis_task.rb', line 32

class AnalysisTask < ActiveRecord::Base
  validates :name, presence: true
  validates :dataset_id, presence: true
  validates :job_type, presence: true

  belongs_to :dataset
  has_attached_file :result, database_table: 'analysis_task_results'

  scope :finished, -> { where('finished_at IS NOT NULL') }
  scope :not_finished, -> { where('finished_at IS NULL') }
  scope :active, -> { not_finished.where(failed: false) }
  scope :failed, -> { not_finished.where(failed: true) }

  # Convert class_name to a class object
  #
  # @api public
  # @param [String] class_name the class name to convert
  # @return [Class] the job class
  # @example Call the view_path method for ExportCitations
  #   AnalysisTask.job_class('ExportCitations').view_path(...)
  def self.job_class(class_name)
    # Never let the 'Base' class match
    class_name = 'Jobs::Analysis::' + class_name
    fail ArgumentError, 'cannot instantiate the Base job' if class_name == 'Jobs::Analysis::Base'

    begin
      klass = class_name.constantize
      fail ArgumentError, "#{class_name} is not a class" unless klass.is_a?(Class)
    rescue NameError
      raise ArgumentError, "#{class_name} is not a valid class"
    end

    klass
  end

  # Convert #job_type into a class object
  #
  # @api public
  # @return [Class] the job class
  # @example Call the view_path method for this task
  #   task.job_class.view_path(...)
  def job_class
    self.class.job_class(job_type)
  end

  # Hook to be called whenever a job finishes
  #
  # This hook will set the finished attribute on the job and send a
  # notification e-mail to the user.
  #
  # @api private
  # @return [undefined]
  def finish!
    # Make sure the task is saved, setting 'finished_at'
    self.finished_at = DateTime.current
    save

    # Send the user an e-mail
    UserMailer.job_finished_email(dataset.user.email, to_param).deliver
  end
end

- (String) result_file_name

Returns The filename of the result file (from Paperclip)

Returns:

  • (String)

    The filename of the result file (from Paperclip)



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'app/models/analysis_task.rb', line 32

class AnalysisTask < ActiveRecord::Base
  validates :name, presence: true
  validates :dataset_id, presence: true
  validates :job_type, presence: true

  belongs_to :dataset
  has_attached_file :result, database_table: 'analysis_task_results'

  scope :finished, -> { where('finished_at IS NOT NULL') }
  scope :not_finished, -> { where('finished_at IS NULL') }
  scope :active, -> { not_finished.where(failed: false) }
  scope :failed, -> { not_finished.where(failed: true) }

  # Convert class_name to a class object
  #
  # @api public
  # @param [String] class_name the class name to convert
  # @return [Class] the job class
  # @example Call the view_path method for ExportCitations
  #   AnalysisTask.job_class('ExportCitations').view_path(...)
  def self.job_class(class_name)
    # Never let the 'Base' class match
    class_name = 'Jobs::Analysis::' + class_name
    fail ArgumentError, 'cannot instantiate the Base job' if class_name == 'Jobs::Analysis::Base'

    begin
      klass = class_name.constantize
      fail ArgumentError, "#{class_name} is not a class" unless klass.is_a?(Class)
    rescue NameError
      raise ArgumentError, "#{class_name} is not a valid class"
    end

    klass
  end

  # Convert #job_type into a class object
  #
  # @api public
  # @return [Class] the job class
  # @example Call the view_path method for this task
  #   task.job_class.view_path(...)
  def job_class
    self.class.job_class(job_type)
  end

  # Hook to be called whenever a job finishes
  #
  # This hook will set the finished attribute on the job and send a
  # notification e-mail to the user.
  #
  # @api private
  # @return [undefined]
  def finish!
    # Make sure the task is saved, setting 'finished_at'
    self.finished_at = DateTime.current
    save

    # Send the user an e-mail
    UserMailer.job_finished_email(dataset.user.email, to_param).deliver
  end
end

- (Integer) result_file_size

Returns The size of the result file (from Paperclip)

Returns:

  • (Integer)

    The size of the result file (from Paperclip)



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'app/models/analysis_task.rb', line 32

class AnalysisTask < ActiveRecord::Base
  validates :name, presence: true
  validates :dataset_id, presence: true
  validates :job_type, presence: true

  belongs_to :dataset
  has_attached_file :result, database_table: 'analysis_task_results'

  scope :finished, -> { where('finished_at IS NOT NULL') }
  scope :not_finished, -> { where('finished_at IS NULL') }
  scope :active, -> { not_finished.where(failed: false) }
  scope :failed, -> { not_finished.where(failed: true) }

  # Convert class_name to a class object
  #
  # @api public
  # @param [String] class_name the class name to convert
  # @return [Class] the job class
  # @example Call the view_path method for ExportCitations
  #   AnalysisTask.job_class('ExportCitations').view_path(...)
  def self.job_class(class_name)
    # Never let the 'Base' class match
    class_name = 'Jobs::Analysis::' + class_name
    fail ArgumentError, 'cannot instantiate the Base job' if class_name == 'Jobs::Analysis::Base'

    begin
      klass = class_name.constantize
      fail ArgumentError, "#{class_name} is not a class" unless klass.is_a?(Class)
    rescue NameError
      raise ArgumentError, "#{class_name} is not a valid class"
    end

    klass
  end

  # Convert #job_type into a class object
  #
  # @api public
  # @return [Class] the job class
  # @example Call the view_path method for this task
  #   task.job_class.view_path(...)
  def job_class
    self.class.job_class(job_type)
  end

  # Hook to be called whenever a job finishes
  #
  # This hook will set the finished attribute on the job and send a
  # notification e-mail to the user.
  #
  # @api private
  # @return [undefined]
  def finish!
    # Make sure the task is saved, setting 'finished_at'
    self.finished_at = DateTime.current
    save

    # Send the user an e-mail
    UserMailer.job_finished_email(dataset.user.email, to_param).deliver
  end
end

- (DateTime) result_updated_at

Returns The last updated time of the result file (from Paperclip)

Returns:

  • (DateTime)

    The last updated time of the result file (from Paperclip)



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'app/models/analysis_task.rb', line 32

class AnalysisTask < ActiveRecord::Base
  validates :name, presence: true
  validates :dataset_id, presence: true
  validates :job_type, presence: true

  belongs_to :dataset
  has_attached_file :result, database_table: 'analysis_task_results'

  scope :finished, -> { where('finished_at IS NOT NULL') }
  scope :not_finished, -> { where('finished_at IS NULL') }
  scope :active, -> { not_finished.where(failed: false) }
  scope :failed, -> { not_finished.where(failed: true) }

  # Convert class_name to a class object
  #
  # @api public
  # @param [String] class_name the class name to convert
  # @return [Class] the job class
  # @example Call the view_path method for ExportCitations
  #   AnalysisTask.job_class('ExportCitations').view_path(...)
  def self.job_class(class_name)
    # Never let the 'Base' class match
    class_name = 'Jobs::Analysis::' + class_name
    fail ArgumentError, 'cannot instantiate the Base job' if class_name == 'Jobs::Analysis::Base'

    begin
      klass = class_name.constantize
      fail ArgumentError, "#{class_name} is not a class" unless klass.is_a?(Class)
    rescue NameError
      raise ArgumentError, "#{class_name} is not a valid class"
    end

    klass
  end

  # Convert #job_type into a class object
  #
  # @api public
  # @return [Class] the job class
  # @example Call the view_path method for this task
  #   task.job_class.view_path(...)
  def job_class
    self.class.job_class(job_type)
  end

  # Hook to be called whenever a job finishes
  #
  # This hook will set the finished attribute on the job and send a
  # notification e-mail to the user.
  #
  # @api private
  # @return [undefined]
  def finish!
    # Make sure the task is saved, setting 'finished_at'
    self.finished_at = DateTime.current
    save

    # Send the user an e-mail
    UserMailer.job_finished_email(dataset.user.email, to_param).deliver
  end
end

Class Method Details

+ (Class) job_class(class_name)

Convert class_name to a class object

Examples:

Call the view_path method for ExportCitations

AnalysisTask.job_class('ExportCitations').view_path(...)

Parameters:

  • class_name (String)

    the class name to convert

Returns:

  • (Class)

    the job class



52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'app/models/analysis_task.rb', line 52

def self.job_class(class_name)
  # Never let the 'Base' class match
  class_name = 'Jobs::Analysis::' + class_name
  fail ArgumentError, 'cannot instantiate the Base job' if class_name == 'Jobs::Analysis::Base'

  begin
    klass = class_name.constantize
    fail ArgumentError, "#{class_name} is not a class" unless klass.is_a?(Class)
  rescue NameError
    raise ArgumentError, "#{class_name} is not a valid class"
  end

  klass
end

Instance Method Details

- (undefined) finish!

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Hook to be called whenever a job finishes

This hook will set the finished attribute on the job and send a notification e-mail to the user.

Returns:

  • (undefined)


84
85
86
87
88
89
90
91
# File 'app/models/analysis_task.rb', line 84

def finish!
  # Make sure the task is saved, setting 'finished_at'
  self.finished_at = DateTime.current
  save

  # Send the user an e-mail
  UserMailer.job_finished_email(dataset.user.email, to_param).deliver
end

- (Class) job_class

Convert #job_type into a class object

Examples:

Call the view_path method for this task

task.job_class.view_path(...)

Returns:

  • (Class)

    the job class



73
74
75
# File 'app/models/analysis_task.rb', line 73

def job_class
  self.class.job_class(job_type)
end