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.
290 291 292 293 |
# File 'lib/mcp_client/auth.rb', line 290 def initialize(resource:, authorization_servers:) @resource = resource @authorization_servers = end |
Instance Attribute Details
#authorization_servers ⇒ Object (readonly)
Returns the value of attribute authorization_servers.
286 287 288 |
# File 'lib/mcp_client/auth.rb', line 286 def @authorization_servers end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
286 287 288 |
# File 'lib/mcp_client/auth.rb', line 286 def resource @resource end |
Class Method Details
.from_h(data) ⇒ ResourceMetadata
Create resource metadata from hash
307 308 309 310 311 312 |
# File 'lib/mcp_client/auth.rb', line 307 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
297 298 299 300 301 302 |
# File 'lib/mcp_client/auth.rb', line 297 def to_h { resource: @resource, authorization_servers: @authorization_servers } end |