Sha256: f0cc478f967deef325fb9b5ca11bf6784c48e21a9331f6a91cac0718bb8e83b0

Contents?: true

Size: 779 Bytes

Versions: 4

Compression:

Stored size: 779 Bytes

Contents

require 'weeter/plugins/subscription/http'
require 'weeter/plugins/subscription/redis'

require 'active_support/core_ext/string/inflections'
require 'active_support/core_ext/module/delegation'

module Weeter
  module Plugins
    class SubscriptionPlugin
      delegate :get_initial_filters, :to => :configured_plugin
      delegate :listen_for_filter_update, :to => :configured_plugin
      
      def initialize(client_app_config)
        @config = client_app_config
      end
    
    protected
      def configured_plugin
        @configured_plugin ||= begin
          Weeter.logger.info("Using #{@config.subscription_plugin} subscription plugin")
          Subscription.const_get(@config.subscription_plugin.to_s.camelize).new(@config)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
weeter-0.10.0 lib/weeter/plugins/subscription_plugin.rb
weeter-0.9.2 lib/weeter/plugins/subscription_plugin.rb
weeter-0.9.1 lib/weeter/plugins/subscription_plugin.rb
weeter-0.9.0 lib/weeter/plugins/subscription_plugin.rb