Class: Dtm::Job

Inherits:
Object
  • Object
show all
Defined in:
lib/dtm/job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/dtm/job.rb', line 3

def id
  @id
end

Instance Method Details

#deleteObject



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