Class: Reactor::Plans::UpdateAttribute
- Inherits:
-
CommonAttribute
- Object
- CommonAttribute
- Reactor::Plans::UpdateAttribute
- Defined in:
- lib/reactor/plans/update_attribute.rb
Constant Summary
Constants inherited from CommonAttribute
CommonAttribute::ALLOWED_PARAMS
Instance Method Summary collapse
-
#initialize(*args) ⇒ UpdateAttribute
constructor
A new instance of UpdateAttribute.
- #migrate! ⇒ Object
- #prepapre! ⇒ Object
Methods inherited from CommonAttribute
Methods included from Prepared
Constructor Details
#initialize(*args) ⇒ UpdateAttribute
Returns a new instance of UpdateAttribute.
4 5 6 7 8 |
# File 'lib/reactor/plans/update_attribute.rb', line 4 def initialize(*args) super() (name, x), = separate_arguments(*args) @name = name || [:name] end |
Instance Method Details
#migrate! ⇒ Object
16 17 18 19 |
# File 'lib/reactor/plans/update_attribute.rb', line 16 def migrate! attrib = Reactor::Cm::Attribute.get(@name) migrate_params!(attrib) end |
#prepapre! ⇒ Object
10 11 12 13 14 |
# File 'lib/reactor/plans/update_attribute.rb', line 10 def prepapre! error("name is nil") if @name.nil? error("attribute #{@name} not found") unless Reactor::Cm::Attribute.exists?(@name) prepare_params!(nil) end |