Class: Woods::SessionTracer::Store Abstract
- Inherits:
-
Object
- Object
- Woods::SessionTracer::Store
- Defined in:
- lib/woods/session_tracer/store.rb
Overview
Subclass and implement the required methods.
Abstract store interface for session trace data.
Concrete implementations must define:
-
‘record(session_id, request_data)` — append a request record
-
‘read(session_id)` — return all requests for a session, ordered by timestamp
-
‘sessions(limit:)` — return recent session summaries
-
‘clear(session_id)` — remove a single session
-
‘clear_all` — remove all sessions
Direct Known Subclasses
Instance Method Summary collapse
-
#clear(session_id) ⇒ void
Remove all data for a single session.
-
#clear_all ⇒ void
Remove all session data.
-
#read(session_id) ⇒ Array<Hash>
Read all request records for a session, ordered by timestamp.
-
#record(session_id, request_data) ⇒ void
Append a request record to a session.
-
#sessions(limit: 20) ⇒ Array<Hash>
List recent session summaries.
Instance Method Details
#clear(session_id) ⇒ void
This method returns an undefined value.
Remove all data for a single session.
45 46 47 |
# File 'lib/woods/session_tracer/store.rb', line 45 def clear(session_id) raise NotImplementedError, "#{self.class}#clear must be implemented" end |
#clear_all ⇒ void
This method returns an undefined value.
Remove all session data.
52 53 54 |
# File 'lib/woods/session_tracer/store.rb', line 52 def clear_all raise NotImplementedError, "#{self.class}#clear_all must be implemented" end |
#read(session_id) ⇒ Array<Hash>
Read all request records for a session, ordered by timestamp.
29 30 31 |
# File 'lib/woods/session_tracer/store.rb', line 29 def read(session_id) raise NotImplementedError, "#{self.class}#read must be implemented" end |
#record(session_id, request_data) ⇒ void
This method returns an undefined value.
Append a request record to a session.
21 22 23 |
# File 'lib/woods/session_tracer/store.rb', line 21 def record(session_id, request_data) raise NotImplementedError, "#{self.class}#record must be implemented" end |
#sessions(limit: 20) ⇒ Array<Hash>
List recent session summaries.
37 38 39 |
# File 'lib/woods/session_tracer/store.rb', line 37 def sessions(limit: 20) raise NotImplementedError, "#{self.class}#sessions must be implemented" end |