lib/cloud_powers/synapse/broadcast/broadcast.rb in cloud_powers-0.2.6 vs lib/cloud_powers/synapse/broadcast/broadcast.rb in cloud_powers-0.2.7

- old
+ new

@@ -26,35 +26,35 @@ # def create_distributor(channel) # sns.create_application_platform() # end # Creates a point to connect to for information about a given topic - # @params: name <String>: the name of the Channel/Topic to be created - # @returns: Broadcast::Channel representing the created channel + # === @params: name String: the name of the Channel/Topic to be created + # === @returns: Broadcast::Channel representing the created channel def create_channel!(name) resp = sns.create_topic(name: name) Channel.new(nil, resp.topic_arn) end # Deletes a topic from SNS-land - # @params: channel <Broadcast::Channel> + # === @params: channel <Broadcast::Channel> def delete_channel!(channel) sns.delete_topic(topic_arn: channel.arn) end # Creates a connection to the Broadcast so that new messages will be picked up - # @params: channel <Broadcast::Channel> + # === @params: channel <Broadcast::Channel> def listen_on(channel) sns.subscribe( topic_arn: channel.arn, protocol: 'application', endpoint: channel.endpoint ) end # Lists the created topics in SNS. - # @returns results <Array + # === @returns results <Array def real_channels results = [] next_token = '' loop do resp = sns.list_topics((next_token.empty? ? {} : { next_token: next_token })) @@ -64,10 +64,10 @@ end results end # Send a message to a Channel using SNS#publish - # @params: [opts <Hash>]: + # === @params: [opts <Hash>]: # this includes all the keys AWS uses but for now it only has defaults # for topic_arn and the message def send_broadcast(opts = {}) msg = opts.delete(:message) || ""