Class: Rubizon::SimpleNotificationService

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

Overview

Define a class that generates requests for operations on a topic of the Simple Notification Service (SNS).

Defined Under Namespace

Classes: Topic

Instance Attribute Summary

Attributes inherited from AbstractSig2Product

#arn, #host, #path, #query_elements, #scheme

Instance Method Summary collapse

Methods inherited from AbstractSig2Product

#endpoint, host_from_ARN

Constructor Details

#initialize(credentials, host, scheme = 'http') ⇒ SimpleNotificationService

Initialize the SNS interface. Each instance supports requests to one topic.

credentials - A SecurityCredentials object that encapsulates the

access and secret ids to be used for this product.

arn - The topic served by this object scheme - (optional - default: http) May set to ‘https’ if supported.



13
14
15
16
17
18
19
# File 'lib/rubizon/product/sns.rb', line 13

def initialize(credentials,host,scheme='http')
  super(
    :scheme=>scheme,
    :host=>host
  )
  @credentials= credentials
end

Instance Method Details

#create_requestObject

Create a Request object that can be used to formulate a single request for this product.

Returns an instance of Request



25
26
27
# File 'lib/rubizon/product/sns.rb', line 25

def create_request
  super(@credentials)
end

#topic(arn) ⇒ Object

Define a topic.

arn - The ARN of the topic

Returns a SimpleNotificationService::Topic object, which includes methods for making requests of and for the topic.



65
66
67
# File 'lib/rubizon/product/sns.rb', line 65

def topic(arn)
  Topic.new(self,arn)
end