Class: ClaudeSDK::McpServerConfig::SSEServer
- Inherits:
-
Object
- Object
- ClaudeSDK::McpServerConfig::SSEServer
- Defined in:
- lib/claude_sdk/types.rb
Overview
MCP SSE server configuration
Instance Attribute Summary collapse
-
#headers ⇒ Object
HTTP headers.
-
#type ⇒ Object
Returns the value of attribute type.
-
#url ⇒ Object
the server URL.
Instance Method Summary collapse
-
#initialize(url:, headers: {}) ⇒ SSEServer
constructor
A new instance of SSEServer.
-
#to_h ⇒ Hash
Convert to hash for JSON serialization.
Constructor Details
#initialize(url:, headers: {}) ⇒ SSEServer
Returns a new instance of SSEServer.
76 77 78 79 80 |
# File 'lib/claude_sdk/types.rb', line 76 def initialize(url:, headers: {}) @type = :sse @url = url @headers = headers end |
Instance Attribute Details
#headers ⇒ Object
HTTP headers
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/claude_sdk/types.rb', line 70 class SSEServer attr_accessor :url, :headers attr_reader :type # @param url [String] the server URL # @param headers [Hash<String, String>] HTTP headers def initialize(url:, headers: {}) @type = :sse @url = url @headers = headers end # Convert to hash for JSON serialization # # @return [Hash] def to_h hash = { type: type.to_s, url: url } hash[:headers] = headers unless headers.empty? hash end end |
#type ⇒ Object
Returns the value of attribute type.
72 73 74 |
# File 'lib/claude_sdk/types.rb', line 72 def type @type end |
#url ⇒ Object
the server URL
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/claude_sdk/types.rb', line 70 class SSEServer attr_accessor :url, :headers attr_reader :type # @param url [String] the server URL # @param headers [Hash<String, String>] HTTP headers def initialize(url:, headers: {}) @type = :sse @url = url @headers = headers end # Convert to hash for JSON serialization # # @return [Hash] def to_h hash = { type: type.to_s, url: url } hash[:headers] = headers unless headers.empty? hash end end |
Instance Method Details
#to_h ⇒ Hash
Convert to hash for JSON serialization
85 86 87 88 89 |
# File 'lib/claude_sdk/types.rb', line 85 def to_h hash = { type: type.to_s, url: url } hash[:headers] = headers unless headers.empty? hash end |