Sha256: ffe8e3521e6e9b08d6fc528f0ff8ff573d161e1627507e428e69a27ede058782
Contents?: true
Size: 655 Bytes
Versions: 49
Compression:
Stored size: 655 Bytes
Contents
# -*- encoding : utf-8 -*- module Reactor module Plans class CommonChannel include Prepared ALLOWED_PARAMS = [:title] def initialize @params = {} end def set(key,value) @params[key.to_sym] = value end def migrate! raise "#{self.class.name} did not implement migrate!" end protected def prepare_params!(channel=nil) @params.keys.each{|k| error("unknown parameter: #{k}") unless ALLOWED_PARAMS.include? k} end def migrate_params!(channel) @params.each{|k,v|channel.send(:"#{k}=",v)} channel.save! end end end end
Version data entries
49 entries across 49 versions & 2 rubygems