Sha256: 88c6ccb4a451a36417ab4c810c091623b46dfabf344ad02f32fec884cf40d50e

Contents?: true

Size: 386 Bytes

Versions: 3

Compression:

Stored size: 386 Bytes

Contents

module Propono
  class PostSubscriber
    include Sns

    def self.subscribe(topic, endpoint)
      new(topic, endpoint).subscribe
    end

    def initialize(topic_id, endpoint)
      @topic_id = topic_id
      @endpoint = endpoint
    end

    def subscribe
      topic_arn = TopicCreator.find_or_create(@topic_id)
      sns.subscribe(topic_arn, @endpoint, 'http')
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
propono-0.3.0 lib/propono/services/post_subscriber.rb
propono-0.2.0 lib/propono/services/post_subscriber.rb
propono-0.1.0 lib/propono/post_subscriber.rb