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.
6 7 8 9 10 11 12 13 14 |
# File 'lib/reactor/plans/create_group.rb', line 6 def initialize(*args) super() (name,), = separate_arguments(*args) @name = name || [:name] set(:name, @name) end |
Instance Method Details
#migrate! ⇒ Object
23 24 25 |
# File 'lib/reactor/plans/create_group.rb', line 23 def migrate! Reactor::Cm::Group.create(@params) end |
#prepare! ⇒ Object
16 17 18 19 20 21 |
# File 'lib/reactor/plans/create_group.rb', line 16 def prepare! error("name is nil") if @name.nil? error("group #{@name} already exists") if Reactor::Cm::Group.exists?(@name) prepare_params!(nil) end |