Class: Dtm::Job
- Inherits:
-
Object
- Object
- Dtm::Job
- Defined in:
- lib/dtm/job.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(dtm, job_id) ⇒ Job
constructor
A new instance of Job.
- #schedule(params) ⇒ Object
Constructor Details
#initialize(dtm, job_id) ⇒ Job
Returns a new instance of Job.
4 5 6 7 |
# File 'lib/dtm/job.rb', line 4 def initialize(dtm, job_id) @dtm = dtm @id = job_id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/dtm/job.rb', line 3 def id @id end |
Instance Method Details
#delete ⇒ Object
9 10 11 12 13 |
# File 'lib/dtm/job.rb', line 9 def delete #FIXME check whether delete is successful or not #Delete job will also delete associated schedules @dtm.delete_job(:job_id => @id) end |
#schedule(params) ⇒ Object
15 16 17 18 |
# File 'lib/dtm/job.rb', line 15 def schedule(params) params[:job_id] = @id @dtm.schedule_job(params) end |