Sha256: 058b26a525605a742544b303a5164b36ba0c3e35f3e930907f5a64b7bb68e0bb

Contents?: true

Size: 686 Bytes

Versions: 13

Compression:

Stored size: 686 Bytes

Contents

# This is a basic implementation of the Notification service using Amazon SNS.
# The expected usage is as follows :
#   notification_service = DispatchRider::NotificationServices::AwsSns.new
#   notification_service.publish(:to => [:foo, :oof], :message => {:subject => "bar", :body => "baz"})
module DispatchRider
  module NotificationServices
    class AwsSns < Base
      def notifier_builder
        AWS::SNS
      rescue NameError
        raise AdapterNotFoundError.new(self.class.name, 'aws-sdk')
      end

      def channel_registrar_builder
        Registrars::SnsChannel
      end

      def channel(name)
        notifier.topics[self.fetch(name)]
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
dispatch-rider-0.2.5 lib/dispatch-rider/notification_services/aws_sns.rb
dispatch-rider-0.2.4 lib/dispatch-rider/notification_services/aws_sns.rb
dispatch-rider-0.2.3 lib/dispatch-rider/notification_services/aws_sns.rb
dispatch-rider-0.2.2 lib/dispatch-rider/notification_services/aws_sns.rb
dispatch-rider-0.2.1 lib/dispatch-rider/notification_services/aws_sns.rb
dispatch-rider-0.2.0 lib/dispatch-rider/notification_services/aws_sns.rb
dispatch-rider-0.1.2 lib/dispatch-rider/notification_services/aws_sns.rb
dispatch-rider-0.1.1.1 lib/dispatch-rider/notification_services/aws_sns.rb
dispatch-rider-0.1.0 lib/dispatch-rider/notification_services/aws_sns.rb
dispatch-rider-0.0.7 lib/dispatch-rider/notification_services/aws_sns.rb
dispatch-rider-0.0.5 lib/dispatch-rider/notification_services/aws_sns.rb
dispatch-rider-0.0.4 lib/dispatch-rider/notification_services/aws_sns.rb
dispatch-rider-0.0.3 lib/dispatch-rider/notification_services/aws_sns.rb