Class: Google::Apis::RequestOptions

Inherits:
Struct
  • Object
show all
Defined in:
lib/google/apis/options.rb,
lib/google/apis/options.rb

Overview

Request options

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#authorizationSignet::OAuth2::Client, #apply(Hash)

Returns OAuth2 credentials.

Returns:

  • (Signet::OAuth2::Client, #apply(Hash))

    OAuth2 credentials



49
50
51
# File 'lib/google/apis/options.rb', line 49

def authorization
  @authorization
end

#headerHash<String,String] Additional HTTP headers to include in requests

Returns Hash<String,String] Additional HTTP headers to include in requests.

Returns:

  • (Hash<String,String] Additional HTTP headers to include in requests)

    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_secFixnum

Returns How long, in seconds, before failed connections time out.

Returns:

  • (Fixnum)

    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

#retriesFixnum

Returns Number of times to retry requests on server error.

Returns:

  • (Fixnum)

    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_secFixnum

Returns How long, in seconds, before requests time out.

Returns:

  • (Fixnum)

    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

.defaultGoogle::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(options)
  return self if options.nil?

  new_options = dup
  members.each do |opt|
    opt = opt.to_sym
    new_options[opt] = options[opt] unless options[opt].nil?
  end
  new_options
end