Class: ClaudeSDK::McpServerConfig::HttpServer
- Inherits:
-
Object
- Object
- ClaudeSDK::McpServerConfig::HttpServer
- Defined in:
- lib/claude_sdk/types.rb
Overview
MCP HTTP 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: {}) ⇒ HttpServer
constructor
A new instance of HttpServer.
-
#to_h ⇒ Hash
Convert to hash for JSON serialization.
Constructor Details
#initialize(url:, headers: {}) ⇒ HttpServer
Returns a new instance of HttpServer.
103 104 105 106 107 |
# File 'lib/claude_sdk/types.rb', line 103 def initialize(url:, headers: {}) @type = :http @url = url @headers = headers end |
Instance Attribute Details
#headers ⇒ Object
HTTP headers
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/claude_sdk/types.rb', line 97 class HttpServer 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 = :http @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.
99 100 101 |
# File 'lib/claude_sdk/types.rb', line 99 def type @type end |
#url ⇒ Object
the server URL
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/claude_sdk/types.rb', line 97 class HttpServer 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 = :http @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
112 113 114 115 116 |
# File 'lib/claude_sdk/types.rb', line 112 def to_h hash = { type: type.to_s, url: url } hash[:headers] = headers unless headers.empty? hash end |