Class: MCP::Resource
- Inherits:
-
Object
- Object
- MCP::Resource
- Defined in:
- lib/mcp/resource.rb,
lib/mcp/resource/contents.rb,
lib/mcp/resource/embedded.rb
Defined Under Namespace
Classes: BlobContents, Contents, Embedded, TextContents
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#mime_type ⇒ Object
readonly
Returns the value of attribute mime_type.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(uri:, name:, title: nil, description: nil, mime_type: nil) ⇒ Resource
constructor
A new instance of Resource.
- #to_h ⇒ Object
Constructor Details
#initialize(uri:, name:, title: nil, description: nil, mime_type: nil) ⇒ Resource
Returns a new instance of Resource.
7 8 9 10 11 12 13 |
# File 'lib/mcp/resource.rb', line 7 def initialize(uri:, name:, title: nil, description: nil, mime_type: nil) @uri = uri @name = name @title = title @description = description @mime_type = mime_type end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
5 6 7 |
# File 'lib/mcp/resource.rb', line 5 def description @description end |
#mime_type ⇒ Object (readonly)
Returns the value of attribute mime_type.
5 6 7 |
# File 'lib/mcp/resource.rb', line 5 def mime_type @mime_type end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/mcp/resource.rb', line 5 def name @name end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/mcp/resource.rb', line 5 def title @title end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
5 6 7 |
# File 'lib/mcp/resource.rb', line 5 def uri @uri end |
Instance Method Details
#to_h ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/mcp/resource.rb', line 15 def to_h { uri: uri, name: name, title: title, description: description, mimeType: mime_type, }.compact end |