Class: Reactor::Plans::CreateJob

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

Constant Summary

Constants inherited from CommonJob

Reactor::Plans::CommonJob::ALLOWED_PARAMS

Instance Method Summary collapse

Methods inherited from CommonJob

#set

Methods included from Prepared

#error, #separate_arguments

Constructor Details

#initialize(*args) ⇒ CreateJob

Returns a new instance of CreateJob.



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

def initialize(*args)
  super()
  (name, x), options = separate_arguments(*args)
  @name = name || options[:name]
end

Instance Method Details

#migrate!Object



18
19
20
# File 'lib/reactor/plans/create_job.rb', line 18

def migrate!
  job = Reactor::Cm::Job.create(@name, @params)
end

#prepare!Object



14
15
16
# File 'lib/reactor/plans/create_job.rb', line 14

def prepare!
  error("name is nil") if @name.nil?
end