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.
524 525 526 527 528 |
# File 'lib/mcp_client/auth.rb', line 524 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.
518 519 520 |
# File 'lib/mcp_client/auth.rb', line 518 def @authorization_servers end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
518 519 520 |
# File 'lib/mcp_client/auth.rb', line 518 def resource @resource end |
#scopes_supported ⇒ Object (readonly)
Returns the value of attribute scopes_supported.
518 519 520 |
# File 'lib/mcp_client/auth.rb', line 518 def scopes_supported @scopes_supported end |
Class Method Details
.from_h(data) ⇒ ResourceMetadata
Create resource metadata from hash
543 544 545 546 547 548 549 |
# File 'lib/mcp_client/auth.rb', line 543 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
532 533 534 535 536 537 538 |
# File 'lib/mcp_client/auth.rb', line 532 def to_h { resource: @resource, authorization_servers: @authorization_servers, scopes_supported: @scopes_supported }.compact end |