Class: Reactor::Plans::CreateGroup
- Inherits:
-
CommonGroup
- Object
- CommonGroup
- Reactor::Plans::CreateGroup
- Defined in:
- lib/reactor/plans/create_group.rb
Constant Summary
Constants inherited from CommonGroup
Reactor::Plans::CommonGroup::ALLOWED_PARAMS
Instance Method Summary collapse
-
#initialize(*args) ⇒ CreateGroup
constructor
A new instance of CreateGroup.
- #migrate! ⇒ Object
- #prepare! ⇒ Object
Methods inherited from CommonGroup
Methods included from Prepared
Constructor Details
#initialize(*args) ⇒ CreateGroup
Returns a new instance of CreateGroup.
10 11 12 13 14 15 16 17 18 |
# File 'lib/reactor/plans/create_group.rb', line 10 def initialize(*args) super() (name, _), = separate_arguments(*args) @name = name || [:name] set(:name, @name) end |
Instance Method Details
#migrate! ⇒ Object
27 28 29 |
# File 'lib/reactor/plans/create_group.rb', line 27 def migrate! Reactor::Cm::Group.create(@params) end |
#prepare! ⇒ Object
20 21 22 23 24 25 |
# File 'lib/reactor/plans/create_group.rb', line 20 def prepare! error('name is nil') if @name.nil? error("group #{@name} already exists") if Reactor::Cm::Group.exists?(@name) prepare_params!(nil) end |