Class: ActionMCP::Client::JsonRpcHandler
- Inherits:
-
JsonRpcHandlerBase
- Object
- JsonRpcHandlerBase
- ActionMCP::Client::JsonRpcHandler
- Defined in:
- lib/action_mcp/client/json_rpc_handler.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Attributes inherited from JsonRpcHandlerBase
Instance Method Summary collapse
-
#call(request) ⇒ Object
Handle client-side JSON-RPC requests/responses.
-
#initialize(transport, client) ⇒ JsonRpcHandler
constructor
A new instance of JsonRpcHandler.
Constructor Details
#initialize(transport, client) ⇒ JsonRpcHandler
Returns a new instance of JsonRpcHandler.
8 9 10 11 |
# File 'lib/action_mcp/client/json_rpc_handler.rb', line 8 def initialize(transport, client) super(transport) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
6 7 8 |
# File 'lib/action_mcp/client/json_rpc_handler.rb', line 6 def client @client end |
Instance Method Details
#call(request) ⇒ Object
Handle client-side JSON-RPC requests/responses
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/action_mcp/client/json_rpc_handler.rb', line 15 def call(request) case request when JSON_RPC::Request handle_request(request) when JSON_RPC::Notification handle_notification(request) when JSON_RPC::Response handle_response(request) end end |