Class: Reactor::Plans::DeleteObjClass

Inherits:
CommonObjClass show all
Includes:
Prepared
Defined in:
lib/reactor/plans/delete_obj_class.rb

Constant Summary

Constants inherited from CommonObjClass

CommonObjClass::ALLOWED_PARAMS

Instance Method Summary collapse

Methods included from Prepared

#error, #separate_arguments

Methods inherited from CommonObjClass

#drop, #set, #take

Constructor Details

#initialize(*args) ⇒ DeleteObjClass

Returns a new instance of DeleteObjClass.



7
8
9
10
11
# File 'lib/reactor/plans/delete_obj_class.rb', line 7

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

Instance Method Details

#migrate!Object



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

def migrate!
  klass = Reactor::Cm::ObjClass.get(@name)
  klass.delete!
end

#prepare!Object



13
14
15
# File 'lib/reactor/plans/delete_obj_class.rb', line 13

def prepare!
  error("objClass #{@name} not found") if not Reactor::Cm::ObjClass.exists?(@name)
end