Class: Eventboss::SnsClient
- Inherits:
-
Object
- Object
- Eventboss::SnsClient
- Defined in:
- lib/eventboss/sns_client.rb
Defined Under Namespace
Classes: Mock
Instance Method Summary collapse
- #create_subscription(topic_arn:, queue_arn:) ⇒ Object
- #create_topic(name:) ⇒ Object
-
#initialize(configuration) ⇒ SnsClient
constructor
A new instance of SnsClient.
- #publish(payload) ⇒ Object
Constructor Details
#initialize(configuration) ⇒ SnsClient
Returns a new instance of SnsClient.
8 9 10 |
# File 'lib/eventboss/sns_client.rb', line 8 def initialize(configuration) @configuration = configuration end |
Instance Method Details
#create_subscription(topic_arn:, queue_arn:) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/eventboss/sns_client.rb', line 20 def create_subscription(topic_arn:, queue_arn:) subscription = backend.subscribe( topic_arn: topic_arn, endpoint: queue_arn, protocol: 'sqs' ) (subscription) end |
#create_topic(name:) ⇒ Object
16 17 18 |
# File 'lib/eventboss/sns_client.rb', line 16 def create_topic(name:) backend.create_topic(name: name) end |
#publish(payload) ⇒ Object
12 13 14 |
# File 'lib/eventboss/sns_client.rb', line 12 def publish(payload) backend.publish(payload) end |