Class: ActionMCP::Client::SessionStoreFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/action_mcp/client/session_store_factory.rb

Overview

Factory for creating session stores

Class Method Summary collapse

Class Method Details

.create(type = nil, **_options) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/action_mcp/client/session_store_factory.rb', line 7

def self.create(type = nil, **_options)
  type ||= default_type

  case type.to_sym
  when :volatile, :memory
    VolatileSessionStore.new
  when :active_record, :persistent
    ActiveRecordSessionStore.new
  when :test
    TestSessionStore.new
  else
    raise ArgumentError, "Unknown session store type: #{type}"
  end
end

.default_typeObject



22
23
24
# File 'lib/action_mcp/client/session_store_factory.rb', line 22

def self.default_type
  ActionMCP.configuration.client_session_store_type
end