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
-
#drive ⇒ Object
readonly
Returns the value of attribute drive.
Instance Method Summary collapse
-
#initialize(authorization) ⇒ ApiClientFetcher
constructor
A new instance of ApiClientFetcher.
- #request_raw(method, url, data, extra_header, _auth) ⇒ Object
Constructor Details
#initialize(authorization) ⇒ ApiClientFetcher
Returns a new instance of ApiClientFetcher.
20 21 22 23 24 25 26 27 |
# File 'lib/google_drive/api_client_fetcher.rb', line 20 def initialize() @drive = Google::Apis::DriveV3::DriveService.new @drive. = # Make the timeout virtually infinite because some of the operations (e.g., uploading a large file) # can take very long. @drive..timeout_sec = 100_000_000 @drive..open_timeout_sec = 100_000_000 end |
Instance Attribute Details
#drive ⇒ Object (readonly)
Returns the value of attribute drive.
29 30 31 |
# File 'lib/google_drive/api_client_fetcher.rb', line 29 def drive @drive end |
Instance Method Details
#request_raw(method, url, data, extra_header, _auth) ⇒ Object
31 32 33 34 35 |
# File 'lib/google_drive/api_client_fetcher.rb', line 31 def request_raw(method, url, data, extra_header, _auth) = @drive..merge(header: extra_header) body = @drive.http(method, url, body: data, options: ) Response.new('200', body) end |