Class: Callapi::Call::RequestMetadata
- Inherits:
-
Struct
- Object
- Struct
- Callapi::Call::RequestMetadata
- Extended by:
- Memoist
- 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
3 4 5 |
# File 'lib/callapi/call/request_metadata.rb', line 3 def context @context end |
Instance Method Details
#request_method ⇒ Object
8 9 10 11 12 |
# File 'lib/callapi/call/request_metadata.rb', line 8 def request_method http_method = namespace_with_http_method raise Callapi::UnknownHttpMethodError unless http_method http_method.downcase.to_sym end |
#request_path ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/callapi/call/request_metadata.rb', line 14 def 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(Callapi::MissingParamError.new(request_path, param_keys_to_replace, missing_keys)) request_path.sub!(param_key + '_param', param_value.to_s) end request_path end |