Class: Plasma::Resource
- Inherits:
-
ModelContextProtocol::Server::Resource
- Object
- ModelContextProtocol::Server::Resource
- Plasma::Resource
- Defined in:
- lib/plasma/resource.rb
Overview
Base resource class for PLASMA applications
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Class Method Summary collapse
-
.schema ⇒ Object
Required by MCP - defines the resource schema rubocop:disable Metrics/MethodLength.
Instance Method Summary collapse
-
#content ⇒ Object
Required by MCP - defines the resource content.
-
#initialize(id:) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
#initialize(id:) ⇒ Resource
Returns a new instance of Resource.
34 35 36 37 |
# File 'lib/plasma/resource.rb', line 34 def initialize(id:) @id = id super end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
32 33 34 |
# File 'lib/plasma/resource.rb', line 32 def id @id end |
Class Method Details
.schema ⇒ Object
Required by MCP - defines the resource schema rubocop:disable Metrics/MethodLength
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/plasma/resource.rb', line 10 def self.schema { name: name.underscore, description: "Base resource for PLASMA applications", content_schema: { type: "object", properties: { id: { type: "string" } }, required: ["id"] } } end |
Instance Method Details
#content ⇒ Object
Required by MCP - defines the resource content
26 27 28 29 30 |
# File 'lib/plasma/resource.rb', line 26 def content { id: id } end |