Sha256: 50e1e37300e5dad697d6f359a0247c83c8cdecc10d241b183d0c1beffbfe078e

Contents?: true

Size: 789 Bytes

Versions: 8

Compression:

Stored size: 789 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::DELETE)
      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

8 entries across 8 versions & 1 rubygems

Version Path
gnip_api-0.0.9 lib/gnip_api/request.rb
gnip_api-0.0.8 lib/gnip_api/request.rb
gnip_api-0.0.7 lib/gnip_api/request.rb
gnip_api-0.0.6 lib/gnip_api/request.rb
gnip_api-0.0.5 lib/gnip_api/request.rb
gnip_api-0.0.4 lib/gnip_api/request.rb
gnip_api-0.0.3 lib/gnip_api/request.rb
gnip_api-0.0.2 lib/gnip_api/request.rb