Class: Rubizon::SimpleNotificationService::Topic
- Inherits:
-
Object
- Object
- Rubizon::SimpleNotificationService::Topic
- Defined in:
- lib/rubizon/product/sns.rb
Instance Method Summary collapse
-
#initialize(sns, arn) ⇒ Topic
constructor
Specify the topic.
-
#publish(message, subject = nil) ⇒ Object
Publish a message to the topic.
Constructor Details
#initialize(sns, arn) ⇒ Topic
Specify the topic.
sns - An instance of the SimpleNotificationService class arn - Specify the topic’s ARN
34 35 36 37 |
# File 'lib/rubizon/product/sns.rb', line 34 def initialize(sns,arn) @sns= sns @arn= arn end |
Instance Method Details
#publish(message, subject = nil) ⇒ Object
Publish a message to the topic.
message - The message you want to send to the topic. subject - Optional parameter to be used as the “Subject” line of when the message is delivered to e-mail endpoints.
Returns the Request object. The url, and its elements may be obtained from the returned request object.
46 47 48 49 50 51 |
# File 'lib/rubizon/product/sns.rb', line 46 def publish(,subject=nil) request= create_request request.add_query_elements('Action'=>'Publish','Message'=>) request.add_query_elements('Subject'=>subject) if subject request end |