Module: ActionMCP::Client::SessionStore
- Included in:
- ActiveRecordSessionStore, VolatileSessionStore
- Defined in:
- lib/action_mcp/client/session_store.rb
Overview
Abstract interface for session storage
Instance Method Summary collapse
-
#delete_session(session_id) ⇒ Object
Delete session.
-
#load_session(session_id) ⇒ Object
Load session data by ID.
-
#save_session(session_id, session_data) ⇒ Object
Save session data.
-
#session_exists?(session_id) ⇒ Boolean
Check if session exists.
-
#update_session(session_id, attributes) ⇒ Object
Update specific session attributes.
Instance Method Details
#delete_session(session_id) ⇒ Object
Delete session
18 19 20 |
# File 'lib/action_mcp/client/session_store.rb', line 18 def delete_session(session_id) raise NotImplementedError, "#{self.class} must implement #delete_session" end |
#load_session(session_id) ⇒ Object
Load session data by ID
8 9 10 |
# File 'lib/action_mcp/client/session_store.rb', line 8 def load_session(session_id) raise NotImplementedError, "#{self.class} must implement #load_session" end |
#save_session(session_id, session_data) ⇒ Object
Save session data
13 14 15 |
# File 'lib/action_mcp/client/session_store.rb', line 13 def save_session(session_id, session_data) raise NotImplementedError, "#{self.class} must implement #save_session" end |
#session_exists?(session_id) ⇒ Boolean
Check if session exists
23 24 25 |
# File 'lib/action_mcp/client/session_store.rb', line 23 def session_exists?(session_id) raise NotImplementedError, "#{self.class} must implement #session_exists?" end |
#update_session(session_id, attributes) ⇒ Object
Update specific session attributes
28 29 30 31 32 33 34 35 36 |
# File 'lib/action_mcp/client/session_store.rb', line 28 def update_session(session_id, attributes) session_data = load_session(session_id) return nil unless session_data session_data.merge!(attributes) save_session(session_id, session_data) # Return the reloaded session to get the actual saved values load_session(session_id) end |