Class: Rubizon::SimpleNotificationService::Topic

Inherits:
Object
  • Object
show all
Defined in:
lib/rubizon/product/sns.rb

Instance Method Summary collapse

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(message,subject=nil)
  request= create_request
  request.add_query_elements('Action'=>'Publish','Message'=>message)
  request.add_query_elements('Subject'=>subject) if subject
  request
end