Sha256: f56ed46bba4e493939018dafcb711eb3363d18a87511cda6e7fd6a4782661dcf
Contents?: true
Size: 649 Bytes
Versions: 8
Compression:
Stored size: 649 Bytes
Contents
module Reactor module Plans class CommonChannel include Prepared ALLOWED_PARAMS = [:title].freeze 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
8 entries across 8 versions & 1 rubygems