Class: Reactor::Plans::CreateChannel

Inherits:
CommonChannel show all
Defined in:
lib/reactor/plans/create_channel.rb

Constant Summary

Constants inherited from CommonChannel

Reactor::Plans::CommonChannel::ALLOWED_PARAMS

Instance Method Summary collapse

Methods inherited from CommonChannel

#set

Methods included from Prepared

#error, #separate_arguments

Constructor Details

#initialize(*args) ⇒ CreateChannel

Returns a new instance of CreateChannel.



8
9
10
11
12
# File 'lib/reactor/plans/create_channel.rb', line 8

def initialize(*args)
  super()
  (name, x), options = separate_arguments(*args)
  @name = name || options[:name]
end

Instance Method Details

#migrate!Object



18
19
20
21
# File 'lib/reactor/plans/create_channel.rb', line 18

def migrate!
  channel = Reactor::Cm::Channel.create(@name)
  migrate_params!(channel)
end

#prepare!Object



14
15
16
# File 'lib/reactor/plans/create_channel.rb', line 14

def prepare!
  error("name is nil") if @name.nil?
end