Class: IdempotentRequest::Callback
- Inherits:
-
Object
- Object
- IdempotentRequest::Callback
- Defined in:
- lib/idempotent_request/callback.rb
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
- #detected(key:) ⇒ Object
-
#initialize(request) ⇒ Callback
constructor
A new instance of Callback.
- #message_params(key:) ⇒ Object
Constructor Details
#initialize(request) ⇒ Callback
Returns a new instance of Callback.
7 8 9 |
# File 'lib/idempotent_request/callback.rb', line 7 def initialize(request) @request = request end |
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
5 6 7 |
# File 'lib/idempotent_request/callback.rb', line 5 def request @request end |
Instance Method Details
#detected(key:) ⇒ Object
11 12 13 |
# File 'lib/idempotent_request/callback.rb', line 11 def detected(key:) Rails.logger.warn "IdempotentRequest request detected, #{(key: key)}" end |
#message_params(key:) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/idempotent_request/callback.rb', line 15 def (key:) { key: key, method: request.request.request_method, path: request.request.path_info } .map { |k, v| "#{k}: #{v}" } .join(", ") end |