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
Returns a new instance of RequestOptionsBuilder.
17 18 19 20 |
# File 'lib/api_proxy/request_options_builder.rb', line 17 def initialize(env, config) @env = env @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/api_proxy/request_options_builder.rb', line 7 def config @config end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
7 8 9 |
# File 'lib/api_proxy/request_options_builder.rb', line 7 def env @env end |
Instance Method Details
#options ⇒ Object
22 23 24 |
# File 'lib/api_proxy/request_options_builder.rb', line 22 def { headers: signature_builder.headers, format: :json } end |
#request_method ⇒ Object
30 31 32 |
# File 'lib/api_proxy/request_options_builder.rb', line 30 def request_method env['REQUEST_METHOD'].to_s.downcase end |
#url ⇒ Object
26 27 28 |
# File 'lib/api_proxy/request_options_builder.rb', line 26 def url URI::Generic.build(scheme: url_scheme, host: api_host, port: api_port, path: path) end |