Class: ApiProxy::RequestOptionsBuilder
- Inherits:
-
Object
- Object
- ApiProxy::RequestOptionsBuilder
- Defined in:
- lib/api_proxy/request_options_builder.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Instance Method Summary collapse
-
#initialize(env, config) ⇒ RequestOptionsBuilder
constructor
A new instance of RequestOptionsBuilder.
- #options ⇒ Object
- #request_method ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(env, config) ⇒ RequestOptionsBuilder
18 19 20 21 |
# File 'lib/api_proxy/request_options_builder.rb', line 18 def initialize(env, config) @env = env @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'lib/api_proxy/request_options_builder.rb', line 8 def config @config end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
8 9 10 |
# File 'lib/api_proxy/request_options_builder.rb', line 8 def env @env end |
Instance Method Details
#options ⇒ Object
23 24 25 |
# File 'lib/api_proxy/request_options_builder.rb', line 23 def { headers: headers, body: body, format: :json } end |
#request_method ⇒ Object
31 32 33 |
# File 'lib/api_proxy/request_options_builder.rb', line 31 def request_method request.request_method.downcase end |
#url ⇒ Object
27 28 29 |
# File 'lib/api_proxy/request_options_builder.rb', line 27 def url URI::Generic.build(scheme: url_scheme, host: api_host, port: api_port, path: path) end |