Class: Karaden::RequestOptionsBuilder
- Inherits:
-
Object
- Object
- Karaden::RequestOptionsBuilder
- Defined in:
- lib/karaden/request_options.rb
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize ⇒ RequestOptionsBuilder
constructor
A new instance of RequestOptionsBuilder.
- #with_api_base(api_base) ⇒ Object
- #with_api_key(api_key) ⇒ Object
- #with_api_version(api_version) ⇒ Object
- #with_connection_timeout(connection_timeout) ⇒ Object
- #with_read_timeout(read_timeout) ⇒ Object
- #with_tenant_id(tenant_id) ⇒ Object
- #with_user_agent(user_agent) ⇒ Object
Constructor Details
#initialize ⇒ RequestOptionsBuilder
Returns a new instance of RequestOptionsBuilder.
99 100 101 |
# File 'lib/karaden/request_options.rb', line 99 def initialize @request_options = RequestOptions.new end |
Instance Method Details
#build ⇒ Object
138 139 140 |
# File 'lib/karaden/request_options.rb', line 138 def build @request_options.clone end |
#with_api_base(api_base) ⇒ Object
103 104 105 106 |
# File 'lib/karaden/request_options.rb', line 103 def with_api_base(api_base) @request_options.api_base = api_base self end |
#with_api_key(api_key) ⇒ Object
108 109 110 111 |
# File 'lib/karaden/request_options.rb', line 108 def with_api_key(api_key) @request_options.api_key = api_key self end |
#with_api_version(api_version) ⇒ Object
113 114 115 116 |
# File 'lib/karaden/request_options.rb', line 113 def with_api_version(api_version) @request_options.api_version = api_version self end |
#with_connection_timeout(connection_timeout) ⇒ Object
128 129 130 131 |
# File 'lib/karaden/request_options.rb', line 128 def with_connection_timeout(connection_timeout) @request_options.connection_timeout = connection_timeout self end |
#with_read_timeout(read_timeout) ⇒ Object
133 134 135 136 |
# File 'lib/karaden/request_options.rb', line 133 def with_read_timeout(read_timeout) @request_options.read_timeout = read_timeout self end |
#with_tenant_id(tenant_id) ⇒ Object
118 119 120 121 |
# File 'lib/karaden/request_options.rb', line 118 def with_tenant_id(tenant_id) @request_options.tenant_id = tenant_id self end |
#with_user_agent(user_agent) ⇒ Object
123 124 125 126 |
# File 'lib/karaden/request_options.rb', line 123 def with_user_agent(user_agent) @request_options.user_agent = user_agent self end |