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

Version Path
infopark_reactor-1.26.1 lib/reactor/plans/common_channel.rb
infopark_reactor-1.26.0 lib/reactor/plans/common_channel.rb
infopark_reactor-1.25.2 lib/reactor/plans/common_channel.rb
infopark_reactor-1.25.1 lib/reactor/plans/common_channel.rb
infopark_reactor-1.25.0 lib/reactor/plans/common_channel.rb
infopark_reactor-1.24.1 lib/reactor/plans/common_channel.rb
infopark_reactor-1.24.0 lib/reactor/plans/common_channel.rb
infopark_reactor-1.23.1 lib/reactor/plans/common_channel.rb
infopark_reactor-1.23.0 lib/reactor/plans/common_channel.rb
infopark_reactor-1.23.0.beta2 lib/reactor/plans/common_channel.rb
infopark_reactor-1.22.6 lib/reactor/plans/common_channel.rb
infopark_reactor-1.22.5 lib/reactor/plans/common_channel.rb
infopark_reactor-1.22.4 lib/reactor/plans/common_channel.rb
infopark_reactor-1.22.3 lib/reactor/plans/common_channel.rb
infopark_reactor-1.22.2 lib/reactor/plans/common_channel.rb
infopark_reactor-1.22.1 lib/reactor/plans/common_channel.rb
infopark_reactor-1.22.0 lib/reactor/plans/common_channel.rb
infopark_reactor-1.21.0 lib/reactor/plans/common_channel.rb
infopark_reactor-1.20.4 lib/reactor/plans/common_channel.rb
infopark_reactor-1.20.3 lib/reactor/plans/common_channel.rb