Sha256: bae49089e3df8133f320492aba3f747d5fc21a155ae5d6457f4a9af0af8e2684

Contents?: true

Size: 825 Bytes

Versions: 10

Compression:

Stored size: 825 Bytes

Contents

require 'weeter/plugins/notification/http'
require 'weeter/plugins/notification/resque'

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

module Weeter
  module Plugins
    class NotificationPlugin
      delegate :publish_tweet,
               :delete_tweet,
               :notify_rate_limiting_initiated,
               :notify_missed_tweets,
            :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.notification_plugin} notification plugin")
          Notification.const_get(@config.notification_plugin.to_s.camelize).new(@config)
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
weeter-0.19.4 lib/weeter/plugins/notification_plugin.rb
weeter-0.19.3 lib/weeter/plugins/notification_plugin.rb
weeter-0.19.2 lib/weeter/plugins/notification_plugin.rb
weeter-0.19.1 lib/weeter/plugins/notification_plugin.rb
weeter-0.19.0 lib/weeter/plugins/notification_plugin.rb
weeter-0.18.0 lib/weeter/plugins/notification_plugin.rb
weeter-0.17.0 lib/weeter/plugins/notification_plugin.rb
weeter-0.15.0 lib/weeter/plugins/notification_plugin.rb
weeter-0.14.0 lib/weeter/plugins/notification_plugin.rb
weeter-0.13.0 lib/weeter/plugins/notification_plugin.rb