Module: Gcloud::Upload

Defined in:
lib/gcloud/upload.rb

Overview

Upload Settings

Upload allows users to configure how files are uploaded to the Google Cloud Service APIs.

require "gcloud/upload"

# Set the default threshold to 10 MiB.
Gcloud::Upload.resumable_threshold = 10_000_000

Class Method Summary collapse

Class Method Details

.resumable_thresholdObject

Retrieve resumable threshold. If uploads are larger in size than this value then resumable uploads are used.

The default value is 5 MiB (5,000,000 bytes).



38
39
40
# File 'lib/gcloud/upload.rb', line 38

def self.resumable_threshold
  @@resumable_threshold
end

.resumable_threshold=(new_resumable_threshold) ⇒ Object

Sets a new resumable threshold value.



44
45
46
47
48
49
# File 'lib/gcloud/upload.rb', line 44

def self.resumable_threshold= new_resumable_threshold
  # rubocop:disable Style/ClassVars
  # Disabled rubocop because this is the best option.
  @@resumable_threshold = new_resumable_threshold.to_i
  # rubocop:enable Style/ClassVars
end