Class: Jobler::Job
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Jobler::Job
- Defined in:
- app/models/jobler/job.rb
Overview
rubocop:disable Rails/ApplicationRecord
Instance Method Summary collapse
Instance Method Details
#completed? ⇒ Boolean
12 13 14 |
# File 'app/models/jobler/job.rb', line 12 def completed? state == "completed" end |
#error? ⇒ Boolean
16 17 18 |
# File 'app/models/jobler/job.rb', line 16 def error? state == "error" end |
#jobler ⇒ Object
8 9 10 |
# File 'app/models/jobler/job.rb', line 8 def jobler @jobler ||= jobler_type.constantize.new(args: YAML.load(parameters), job: self) # rubocop:disable Security/YAMLLoad end |
#to_param ⇒ Object
20 21 22 23 24 |
# File 'app/models/jobler/job.rb', line 20 def to_param raise "No slug" unless slug? slug end |