Class: Callapi::Call::RequestMetadata
- Inherits:
-
Struct
- Object
- Struct
- Callapi::Call::RequestMetadata
- Defined in:
- lib/callapi/call/request_metadata.rb
Constant Summary collapse
- HTTP_METHODS =
%w(GET POST PUT PATCH DELETE)
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
Instance Method Summary collapse
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context
1 2 3 |
# File 'lib/callapi/call/request_metadata.rb', line 1 def context @context end |
Instance Method Details
#request_method ⇒ Object
4 5 6 7 8 |
# File 'lib/callapi/call/request_metadata.rb', line 4 def request_method http_method = namespace_with_http_method raise Callapi::UnknownHttpMethodError unless http_method http_method.downcase.to_sym end |
#request_path ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/callapi/call/request_metadata.rb', line 10 def request_path return @request_path if @request_path @request_path = request_path_without_replaced_param_keys param_keys_to_replace.each do |param_key| param_value = context.params[param_key.to_sym] || raise_missing_param_error @request_path.sub!(param_key + '_param', param_value.to_s) end @request_path end |