Class: RubyLLM::MCP::Auth::ResourceMetadata
- Inherits:
-
Object
- Object
- RubyLLM::MCP::Auth::ResourceMetadata
- Defined in:
- lib/ruby_llm/mcp/auth.rb
Overview
OAuth Protected Resource Metadata (RFC 9728) Used for authorization server delegation
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
Deserialize from hash.
Instance Method Summary collapse
-
#initialize(resource:, authorization_servers:) ⇒ ResourceMetadata
constructor
A new instance of ResourceMetadata.
-
#to_h ⇒ Hash
Serialize to hash.
Constructor Details
#initialize(resource:, authorization_servers:) ⇒ ResourceMetadata
Returns a new instance of ResourceMetadata.
279 280 281 282 |
# File 'lib/ruby_llm/mcp/auth.rb', line 279 def initialize(resource:, authorization_servers:) @resource = resource @authorization_servers = end |
Instance Attribute Details
#authorization_servers ⇒ Object (readonly)
Returns the value of attribute authorization_servers.
277 278 279 |
# File 'lib/ruby_llm/mcp/auth.rb', line 277 def @authorization_servers end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
277 278 279 |
# File 'lib/ruby_llm/mcp/auth.rb', line 277 def resource @resource end |
Class Method Details
.from_h(data) ⇒ ResourceMetadata
Deserialize from hash
296 297 298 299 300 301 |
# File 'lib/ruby_llm/mcp/auth.rb', line 296 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
Serialize to hash
286 287 288 289 290 291 |
# File 'lib/ruby_llm/mcp/auth.rb', line 286 def to_h { resource: @resource, authorization_servers: @authorization_servers } end |