class AWS::SNS::Topic

def subscribe endpoint, options = {}

Returns:
  • (Subscription, nil) - Returns a subscription when possible.

Options Hash: (**options)
  • :json (Boolean) --

Parameters:
  • options (Hash) --
  • endpoint (mixed) -- The endpoint that should receive

Other tags:
    Example: SQS Queue (by Queue object) -
    Example: SQS Queue (by arn) -
    Example: Email address as a JSON endpoint -
    Example: Email address as endpoint -
    Example: Using a uri object to set the endpoint (http and https) -
    Example: Using a url string to set the endpoint (http and https) -
def subscribe endpoint, options = {}
  subscribe_opts = endpoint_opts(endpoint, options).merge(:topic_arn => arn)
  resp = client.subscribe(subscribe_opts)
  if arn = resp[:subscription_arn] and arn =~ /^arn:/
    Subscription.new(arn, :config => config)
  else
    nil
  end
end