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.
-
#scopes_supported ⇒ Object
readonly
Returns the value of attribute scopes_supported.
Class Method Summary collapse
-
.from_h(data) ⇒ ResourceMetadata
Create resource metadata from hash.
Instance Method Summary collapse
-
#initialize(resource:, authorization_servers:, scopes_supported: nil) ⇒ ResourceMetadata
constructor
A new instance of ResourceMetadata.
-
#to_h ⇒ Hash
Convert to hash.
Constructor Details
#initialize(resource:, authorization_servers:, scopes_supported: nil) ⇒ ResourceMetadata
Returns a new instance of ResourceMetadata.
321 322 323 324 325 |
# File 'lib/mcp_client/auth.rb', line 321 def initialize(resource:, authorization_servers:, scopes_supported: nil) @resource = resource @authorization_servers = @scopes_supported = scopes_supported end |
Instance Attribute Details
#authorization_servers ⇒ Object (readonly)
Returns the value of attribute authorization_servers.
315 316 317 |
# File 'lib/mcp_client/auth.rb', line 315 def @authorization_servers end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
315 316 317 |
# File 'lib/mcp_client/auth.rb', line 315 def resource @resource end |
#scopes_supported ⇒ Object (readonly)
Returns the value of attribute scopes_supported.
315 316 317 |
# File 'lib/mcp_client/auth.rb', line 315 def scopes_supported @scopes_supported end |
Class Method Details
.from_h(data) ⇒ ResourceMetadata
Create resource metadata from hash
340 341 342 343 344 345 346 |
# File 'lib/mcp_client/auth.rb', line 340 def self.from_h(data) new( resource: data[:resource] || data['resource'], authorization_servers: data[:authorization_servers] || data['authorization_servers'], scopes_supported: data[:scopes_supported] || data['scopes_supported'] ) end |
Instance Method Details
#to_h ⇒ Hash
Convert to hash
329 330 331 332 333 334 335 |
# File 'lib/mcp_client/auth.rb', line 329 def to_h { resource: @resource, authorization_servers: @authorization_servers, scopes_supported: @scopes_supported }.compact end |