Class: MCPClient::Auth::ResourceMetadata
- Inherits:
-
Object
- Object
- MCPClient::Auth::ResourceMetadata
- Defined in:
- lib/mcp_client/auth.rb
Overview
Protected resource metadata for authorization server discovery
Instance Attribute Summary collapse
-
#authorization_servers ⇒ Object
readonly
Returns the value of attribute authorization_servers.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Class Method Summary collapse
-
.from_h(data) ⇒ ResourceMetadata
Create resource metadata from hash.
Instance Method Summary collapse
-
#initialize(resource:, authorization_servers:) ⇒ ResourceMetadata
constructor
A new instance of ResourceMetadata.
-
#to_h ⇒ Hash
Convert to hash.
Constructor Details
#initialize(resource:, authorization_servers:) ⇒ ResourceMetadata
Returns a new instance of ResourceMetadata.
261 262 263 264 |
# File 'lib/mcp_client/auth.rb', line 261 def initialize(resource:, authorization_servers:) @resource = resource @authorization_servers = end |
Instance Attribute Details
#authorization_servers ⇒ Object (readonly)
Returns the value of attribute authorization_servers.
257 258 259 |
# File 'lib/mcp_client/auth.rb', line 257 def @authorization_servers end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
257 258 259 |
# File 'lib/mcp_client/auth.rb', line 257 def resource @resource end |
Class Method Details
.from_h(data) ⇒ ResourceMetadata
Create resource metadata from hash
278 279 280 281 282 283 |
# File 'lib/mcp_client/auth.rb', line 278 def self.from_h(data) new( resource: data[:resource] || data['resource'], authorization_servers: data[:authorization_servers] || data['authorization_servers'] ) end |
Instance Method Details
#to_h ⇒ Hash
Convert to hash
268 269 270 271 272 273 |
# File 'lib/mcp_client/auth.rb', line 268 def to_h { resource: @resource, authorization_servers: @authorization_servers } end |