Module: Cumulus::SNS

Defined in:
lib/sns/SNS.rb

Constant Summary collapse

@@client =
Aws::SNS::Client.new(Configuration.instance.client)

Class Method Summary collapse

Class Method Details

.get_aws(name) ⇒ Object

Public: Static method that will get an SNS topic from AWS by its name

name - the name of the topic to get

Returns the Aws::SNS::Types::Topic



15
16
17
18
19
20
# File 'lib/sns/SNS.rb', line 15

def get_aws(name)
  topics.fetch(name)
rescue KeyError
  puts "No SNS topic named #{name}"
  exit
end

.topicsObject

Public: Provide a mapping of topics to their names. Lazily loads resources.

Returns the topics mapped to their names



26
27
28
# File 'lib/sns/SNS.rb', line 26

def topics
  @topics ||= init_topics
end