Class: Reactor::Plans::UpdateJob

Inherits:
CommonJob show all
Defined in:
lib/reactor/plans/update_job.rb

Constant Summary

Constants inherited from CommonJob

CommonJob::ALLOWED_PARAMS

Instance Method Summary collapse

Methods inherited from CommonJob

#set

Methods included from Prepared

#error, #separate_arguments

Constructor Details

#initialize(*args) ⇒ UpdateJob

Returns a new instance of UpdateJob.



8
9
10
11
12
13
# File 'lib/reactor/plans/update_job.rb', line 8

def initialize(*args)
  super()

  (name, _), options = separate_arguments(*args)
  @name = name || options[:name]
end

Instance Method Details

#migrate!Object



22
23
24
25
# File 'lib/reactor/plans/update_job.rb', line 22

def migrate!
  job = Reactor::Cm::Job.get(@name)
  migrate_params!(job)
end

#prepapre!Object



15
16
17
18
19
20
# File 'lib/reactor/plans/update_job.rb', line 15

def prepapre!
  error('name is nil') if @name.nil?
  error("job #{@name} not found") unless Reactor::Cm::Job.exists?(@name)

  prepare_params!(nil)
end