Class: Loginator::Request
- Inherits:
-
Struct
- Object
- Struct
- Loginator::Request
- Includes:
- JsonableStruct, Transaction
- Defined in:
- lib/loginator/request.rb
Overview
A request is a tuple of a (UUID, Timestamp, Path, Parameters). Requests parameters are defined subjectively by the user. For example, in the example Rack middleware (#Rack#Rack::Loginator#Rack::Loginator::Logging), we define params as the request body (our HTTP APIs tend to accept JSON bodies as opposed to parameters attached to the URL). You may also wish to consider part of the HTTP headers as a request parameter.
Instance Attribute Summary collapse
-
#params ⇒ Object
Returns the value of attribute params.
-
#path ⇒ Object
Returns the value of attribute path.
-
#request_id ⇒ Object
Returns the value of attribute request_id.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(request_id = uuid, timestamp = format_time, path = nil, params = {}) ⇒ Request
constructor
Create a new Loginator::Request.
Methods included from Transaction
Methods included from JsonableStruct
Constructor Details
#initialize(request_id = uuid, timestamp = format_time, path = nil, params = {}) ⇒ Request
Create a new Loginator::Request
21 22 23 |
# File 'lib/loginator/request.rb', line 21 def initialize(request_id = uuid, = format_time, path = nil, params = {}) super end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params
12 13 14 |
# File 'lib/loginator/request.rb', line 12 def params @params end |
#path ⇒ Object
Returns the value of attribute path
12 13 14 |
# File 'lib/loginator/request.rb', line 12 def path @path end |
#request_id ⇒ Object
Returns the value of attribute request_id
12 13 14 |
# File 'lib/loginator/request.rb', line 12 def request_id @request_id end |
#timestamp ⇒ Object
Returns the value of attribute timestamp
12 13 14 |
# File 'lib/loginator/request.rb', line 12 def @timestamp end |