lib/sns/right_sns_interface.rb
# TODO: RJG - Seems like generate_request and generate_rest_request could be in a sub class?
# Generates a request hash for the sns API
Seems like generate_request and generate_rest_request could be in a sub class.
Generates a request hash for the sns API
Seems like generate_request and generate_rest_request could be in a sub class . Generates a request hash for the sns API
def generate_request(action, params={})  
      service = params[:sns_url] ? URI(params[:sns_url]).path : '/'
      params.each{ |key, value| params.delete(key) if (value.nil? || key.is_a?(Symbol)) }
      service_hash = { "Action"           => action,
                       "Expires"          => (Time.now + REQUEST_TTL).utc.strftime("%Y-%m-%dT%H:%M:%SZ"),
                       "AWSAccessKeyId"   => @aws_access_key_id }
      service_hash.update(params)
      service_params = signed_service_params(@aws_secret_access_key, service_hash, :get, @params[:server], service)
      request        = Net::HTTP::Get.new("#{AwsUtils::URLencode(service)}?#{service_params}")
      { :request  => request,
        :server   => @params[:server],
        :port     => @params[:port],
        :protocol => @params[:protocol] }
    end
def generate_request ( action , params = { } ) service = params [ :sns_url ] ? URI ( params [ :sns_url ] ) . path : '/' params . each { | key , value | params . delete ( key ) if ( value . nil? || key . is_a? ( Symbol ) ) } service_hash = { "Action" => action , "Expires" => ( Time . now + REQUEST_TTL ) . utc . strftime ( "%Y-%m-%dT%H:%M:%SZ" ) , "AWSAccessKeyId" => @aws_access_key_id } service_hash . update ( params ) service_params = signed_service_params ( @aws_secret_access_key , service_hash , :get , @params [ :server ] , service ) request = Net :: HTTP :: Get . new ( "#{AwsUtils::URLencode(service)}?#{service_params}" ) { :request => request , :server => @params [ :server ] , :port => @params [ :port ] , :protocol => @params [ :protocol ] } end
TODO: RJG - Seems like generate_request and generate_rest_request could be in a sub class?
TODO : RJG - Seems like generate_request and generate_rest_request could be in a sub class?
# :nodoc: # Sometimes we need to use queue uri (delete queue etc) # In that case we will use Symbol key: 'param[:queue_url]' # remove unset(=optional) and symbolyc keys # prepare output hash #"Version"          => API_VERSION } # prepare output hash
action
<not_specific>
params
<not_specific>