Sha256: 9f2aa5f78524e7ff40a455d10158478affa19803b636dfcf84c53e7b960cfd49

Contents?: true

Size: 787 Bytes

Versions: 11

Compression:

Stored size: 787 Bytes

Contents

module GnipApi
  class Request
    attr_reader :uri, :payload, :headers, :request_method

    class << self
      def new_get uri, headers=nil
        new(:uri => uri, :headers => headers, :request_method => GnipApi::Adapter::GET, )
      end
      
      def new_post uri, payload, headers=nil
        new(:uri => uri, :headers => headers, :payload => payload, :request_method => GnipApi::Adapter::POST)
      end
      
      def new_delete uri, payload, headers=nil
        new(:uri => uri, :headers => headers, :payload => payload, :request_method => GnipApi::Adapter::POST)
      end
    end

    def initialize params={}
      @uri = params[:uri]
      @payload = params[:payload]
      @headers = params[:headers]
      @request_method = params[:request_method]
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
gnip_api-1.1.3 lib/gnip_api/request.rb
gnip_api-1.1.2 lib/gnip_api/request.rb
gnip_api-1.1.1 lib/gnip_api/request.rb
gnip_api-1.1.0 lib/gnip_api/request.rb
gnip_api-1.0.6 lib/gnip_api/request.rb
gnip_api-1.0.5 lib/gnip_api/request.rb
gnip_api-1.0.4 lib/gnip_api/request.rb
gnip_api-1.0.3 lib/gnip_api/request.rb
gnip_api-1.0.2 lib/gnip_api/request.rb
gnip_api-1.0.1 lib/gnip_api/request.rb
gnip_api-1.0.0 lib/gnip_api/request.rb