Class: Karaden::RequestOptionsBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/karaden/request_options.rb

Instance Method Summary collapse

Constructor Details

#initializeRequestOptionsBuilder

Returns a new instance of RequestOptionsBuilder.



112
113
114
# File 'lib/karaden/request_options.rb', line 112

def initialize
  @request_options = RequestOptions.new
end

Instance Method Details

#buildObject



151
152
153
# File 'lib/karaden/request_options.rb', line 151

def build
  @request_options.clone
end

#with_api_base(api_base) ⇒ Object



116
117
118
119
# File 'lib/karaden/request_options.rb', line 116

def with_api_base(api_base)
  @request_options.api_base = api_base
  self
end

#with_api_key(api_key) ⇒ Object



121
122
123
124
# File 'lib/karaden/request_options.rb', line 121

def with_api_key(api_key)
  @request_options.api_key = api_key
  self
end

#with_api_version(api_version) ⇒ Object



126
127
128
129
# File 'lib/karaden/request_options.rb', line 126

def with_api_version(api_version)
  @request_options.api_version = api_version
  self
end

#with_connection_timeout(connection_timeout) ⇒ Object



141
142
143
144
# File 'lib/karaden/request_options.rb', line 141

def with_connection_timeout(connection_timeout)
  @request_options.connection_timeout = connection_timeout
  self
end

#with_read_timeout(read_timeout) ⇒ Object



146
147
148
149
# File 'lib/karaden/request_options.rb', line 146

def with_read_timeout(read_timeout)
  @request_options.read_timeout = read_timeout
  self
end

#with_tenant_id(tenant_id) ⇒ Object



131
132
133
134
# File 'lib/karaden/request_options.rb', line 131

def with_tenant_id(tenant_id)
  @request_options.tenant_id = tenant_id
  self
end

#with_user_agent(user_agent) ⇒ Object



136
137
138
139
# File 'lib/karaden/request_options.rb', line 136

def with_user_agent(user_agent)
  @request_options.user_agent = user_agent
  self
end