Sha256: 3068b9cc2f04d536fc3885459992a9ff17c8f4866a6a42ce31ff413c4d5b7491
Contents?: true
Size: 475 Bytes
Versions: 10
Compression:
Stored size: 475 Bytes
Contents
module Propono class TopicCreatorError < Exception end class TopicCreator include Sns def self.find_or_create(topic_id) new(topic_id).find_or_create end def initialize(topic_id) @topic_id = topic_id end def find_or_create result = sns.create_topic(@topic_id) body = result.body arn = body.fetch('TopicArn') { raise TopicCreatorError.new("No TopicArn returned from SNS") } Topic.new(arn) end end end
Version data entries
10 entries across 10 versions & 1 rubygems