Class: Reactor::Plans::DeleteAttribute
Constant Summary
CommonAttribute::ALLOWED_PARAMS
Instance Method Summary
collapse
#set
Methods included from Prepared
#error, #separate_arguments
Constructor Details
5
6
7
8
9
|
# File 'lib/reactor/plans/delete_attribute.rb', line 5
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_attribute.rb', line 17
def migrate!
attrib = Reactor::Cm::Attribute.get(@name)
attrib.delete!
end
|
#prepare! ⇒ Object
11
12
13
14
15
|
# File 'lib/reactor/plans/delete_attribute.rb', line 11
def prepare!
error("name is nil") if @name.nil?
error("attribute #{@name} does not exist") if not Reactor::Cm::Attribute.exists?(@name)
end
|