class Reactor::Plans::CommonChannel

Constants

ALLOWED_PARAMS

Public Class Methods

new() click to toggle source
# File lib/reactor/plans/common_channel.rb, line 8
def initialize
  @params = {}
end

Public Instance Methods

migrate!() click to toggle source
# File lib/reactor/plans/common_channel.rb, line 16
def migrate!
  raise "#{self.class.name} did not implement migrate!"
end
set(key,value) click to toggle source
# File lib/reactor/plans/common_channel.rb, line 12
def set(key,value)
  @params[key.to_sym] = value
end

Protected Instance Methods

migrate_params!(channel) click to toggle source
# File lib/reactor/plans/common_channel.rb, line 25
def migrate_params!(channel)
  @params.each{|k,v|channel.send(:"#{k}=",v)}
  channel.save!
end
prepare_params!(channel=nil) click to toggle source
# File lib/reactor/plans/common_channel.rb, line 21
def prepare_params!(channel=nil)
  @params.keys.each{|k| error("unknown parameter: #{k}") unless ALLOWED_PARAMS.include? k}
end