Class: GoogleDrive::ApiClientFetcher
- Inherits:
-
Object
- Object
- GoogleDrive::ApiClientFetcher
- Defined in:
- lib/google_drive/api_client_fetcher.rb
Defined Under Namespace
Classes: Response
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#drive ⇒ Object
readonly
Returns the value of attribute drive.
Instance Method Summary collapse
-
#initialize(client) ⇒ ApiClientFetcher
constructor
A new instance of ApiClientFetcher.
- #request_raw(method, url, data, extra_header, auth) ⇒ Object
Constructor Details
#initialize(client) ⇒ ApiClientFetcher
Returns a new instance of ApiClientFetcher.
31 32 33 34 35 36 37 |
# File 'lib/google_drive/api_client_fetcher.rb', line 31 def initialize(client) @client = client # Sets virtually infinite default timeout because some operations (e.g., uploading # a large files/spreadsheets) can take very long. @client.connection.[:timeout] ||= 100000000 @drive = @client.discovered_api("drive", "v2") end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
39 40 41 |
# File 'lib/google_drive/api_client_fetcher.rb', line 39 def client @client end |
#drive ⇒ Object (readonly)
Returns the value of attribute drive.
39 40 41 |
# File 'lib/google_drive/api_client_fetcher.rb', line 39 def drive @drive end |
Instance Method Details
#request_raw(method, url, data, extra_header, auth) ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'lib/google_drive/api_client_fetcher.rb', line 41 def request_raw(method, url, data, extra_header, auth) client_response = @client.execute( :http_method => method, :uri => url, :body => data, :headers => extra_header) return Response.new(client_response) end |