Class: Google::Apis::RequestOptions
- Inherits:
-
Struct
- Object
- Struct
- Google::Apis::RequestOptions
- Defined in:
- lib/google/apis/options.rb,
lib/google/apis/options.rb
Overview
Request options
Instance Attribute Summary collapse
-
#authorization ⇒ Signet::OAuth2::Client, #apply(Hash)
OAuth2 credentials.
-
#header ⇒ Hash<String,String] Additional HTTP headers to include in requests
Hash<String,String] Additional HTTP headers to include in requests.
-
#open_timeout_sec ⇒ Fixnum
How long, in seconds, before failed connections time out.
-
#retries ⇒ Fixnum
Number of times to retry requests on server error.
-
#timeout_sec ⇒ Fixnum
How long, in seconds, before requests time out.
Class Method Summary collapse
-
.default ⇒ Google::Apis::RequestOptions
Get the default options.
Instance Method Summary collapse
Instance Attribute Details
#authorization ⇒ Signet::OAuth2::Client, #apply(Hash)
Returns OAuth2 credentials.
49 50 51 |
# File 'lib/google/apis/options.rb', line 49 def @authorization end |
#header ⇒ Hash<String,String] Additional HTTP headers to include in requests
Returns Hash<String,String] Additional HTTP headers to include in requests.
49 50 51 |
# File 'lib/google/apis/options.rb', line 49 def header @header end |
#open_timeout_sec ⇒ Fixnum
Returns How long, in seconds, before failed connections time out.
49 50 51 |
# File 'lib/google/apis/options.rb', line 49 def open_timeout_sec @open_timeout_sec end |
#retries ⇒ Fixnum
Returns Number of times to retry requests on server error.
49 50 51 |
# File 'lib/google/apis/options.rb', line 49 def retries @retries end |
#timeout_sec ⇒ Fixnum
Returns How long, in seconds, before requests time out.
49 50 51 |
# File 'lib/google/apis/options.rb', line 49 def timeout_sec @timeout_sec end |
Class Method Details
.default ⇒ Google::Apis::RequestOptions
Get the default options
62 63 64 |
# File 'lib/google/apis/options.rb', line 62 def self.default @options ||= RequestOptions.new end |
Instance Method Details
#merge(options) ⇒ Object
66 67 68 69 70 71 72 73 74 75 |
# File 'lib/google/apis/options.rb', line 66 def merge() return self if .nil? = dup members.each do |opt| opt = opt.to_sym [opt] = [opt] unless [opt].nil? end end |