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.
325 326 327 328 329 |
# File 'lib/mcp_client/auth.rb', line 325 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.
319 320 321 |
# File 'lib/mcp_client/auth.rb', line 319 def @authorization_servers end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
319 320 321 |
# File 'lib/mcp_client/auth.rb', line 319 def resource @resource end |
#scopes_supported ⇒ Object (readonly)
Returns the value of attribute scopes_supported.
319 320 321 |
# File 'lib/mcp_client/auth.rb', line 319 def scopes_supported @scopes_supported end |
Class Method Details
.from_h(data) ⇒ ResourceMetadata
Create resource metadata from hash
344 345 346 347 348 349 350 |
# File 'lib/mcp_client/auth.rb', line 344 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
333 334 335 336 337 338 339 |
# File 'lib/mcp_client/auth.rb', line 333 def to_h { resource: @resource, authorization_servers: @authorization_servers, scopes_supported: @scopes_supported }.compact end |