Class: Reactor::Plans::DeleteChannel
- Inherits:
-
CommonAttribute
- Object
- CommonAttribute
- Reactor::Plans::DeleteChannel
- Defined in:
- lib/reactor/plans/delete_channel.rb
Constant Summary
Constants inherited from CommonAttribute
CommonAttribute::ALLOWED_PARAMS
Instance Method Summary collapse
-
#initialize(*args) ⇒ DeleteChannel
constructor
A new instance of DeleteChannel.
- #migrate! ⇒ Object
- #prepare! ⇒ Object
Methods inherited from CommonAttribute
Methods included from Prepared
Constructor Details
#initialize(*args) ⇒ DeleteChannel
Returns a new instance of DeleteChannel.
5 6 7 8 9 |
# File 'lib/reactor/plans/delete_channel.rb', line 5 def initialize(*args) super() (name, x), = separate_arguments(*args) @name = name || [:name] end |
Instance Method Details
#migrate! ⇒ Object
16 17 18 |
# File 'lib/reactor/plans/delete_channel.rb', line 16 def migrate! Reactor::Cm::Channel.get(@name).delete! end |
#prepare! ⇒ Object
11 12 13 14 |
# File 'lib/reactor/plans/delete_channel.rb', line 11 def prepare! error("name is nil") if @name.nil? error("channel #{@name} does not exist") if not Reactor::Cm::Channel.exists?(@name) end |