Class: Reactor::Plans::DeleteObj
- Inherits:
-
Object
- Object
- Reactor::Plans::DeleteObj
show all
- Includes:
- Prepared
- Defined in:
- lib/reactor/plans/delete_obj.rb
Instance Method Summary
collapse
Methods included from Prepared
#error, #separate_arguments
Constructor Details
#initialize(opts = {}) ⇒ DeleteObj
Returns a new instance of DeleteObj.
9
10
11
|
# File 'lib/reactor/plans/delete_obj.rb', line 9
def initialize(opts={})
@key = opts[:obj_id] || opts[:path]
end
|
Instance Method Details
#migrate! ⇒ Object
17
18
19
20
|
# File 'lib/reactor/plans/delete_obj.rb', line 17
def migrate!
obj = Reactor::Cm::Obj.get(@key)
obj.delete!
end
|
#prepare! ⇒ Object
13
14
15
|
# File 'lib/reactor/plans/delete_obj.rb', line 13
def prepare!
error("object (key=#{@key}) not found") if not Reactor::Cm::Obj.exists?(@key)
end
|