class Circuitry::Provisioning::TopicCreator

Attributes

topic_name[RW]

Public Class Methods

find_or_create(topic_name) click to toggle source
# File lib/circuitry/provisioning/topic_creator.rb, line 11
def self.find_or_create(topic_name)
  new(topic_name).topic
end
new(topic_name) click to toggle source
# File lib/circuitry/provisioning/topic_creator.rb, line 15
def initialize(topic_name)
  self.topic_name = topic_name
end

Public Instance Methods

topic() click to toggle source
# File lib/circuitry/provisioning/topic_creator.rb, line 19
def topic
  return @topic if defined?(@topic)

  response = sns.create_topic(name: topic_name)
  @topic = Topic.new(response.topic_arn)
end