Class: GoogleDrive::OAuth2Fetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/google_drive/oauth2_fetcher.rb

Overview

:nodoc:

Defined Under Namespace

Classes: Response

Instance Method Summary collapse

Constructor Details

#initialize(oauth2_token) ⇒ OAuth2Fetcher

Returns a new instance of OAuth2Fetcher.



32
33
34
# File 'lib/google_drive/oauth2_fetcher.rb', line 32

def initialize(oauth2_token)
  @oauth2_token = oauth2_token
end

Instance Method Details

#request_raw(method, url, data, extra_header, auth) ⇒ Object



36
37
38
39
40
41
42
43
# File 'lib/google_drive/oauth2_fetcher.rb', line 36

def request_raw(method, url, data, extra_header, auth)
  if method == :delete || method == :get
    raw_res = @oauth2_token.request(method, url, {:headers => extra_header})
  else
    raw_res = @oauth2_token.request(method, url, {:headers => extra_header, :body => data})
  end
  return Response.new(raw_res)
end