Class: MCP::Resource::Contents
- Inherits:
-
Object
- Object
- MCP::Resource::Contents
- Defined in:
- lib/mcp/resource/contents.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#mime_type ⇒ Object
readonly
Returns the value of attribute mime_type.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(uri:, mime_type: nil, meta: nil) ⇒ Contents
constructor
A new instance of Contents.
- #to_h ⇒ Object
Constructor Details
#initialize(uri:, mime_type: nil, meta: nil) ⇒ Contents
Returns a new instance of Contents.
8 9 10 11 12 |
# File 'lib/mcp/resource/contents.rb', line 8 def initialize(uri:, mime_type: nil, meta: nil) @uri = uri @mime_type = mime_type @meta = end |
Instance Attribute Details
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
6 7 8 |
# File 'lib/mcp/resource/contents.rb', line 6 def @meta end |
#mime_type ⇒ Object (readonly)
Returns the value of attribute mime_type.
6 7 8 |
# File 'lib/mcp/resource/contents.rb', line 6 def mime_type @mime_type end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
6 7 8 |
# File 'lib/mcp/resource/contents.rb', line 6 def uri @uri end |
Instance Method Details
#to_h ⇒ Object
14 15 16 |
# File 'lib/mcp/resource/contents.rb', line 14 def to_h { uri: uri, mimeType: mime_type, _meta: }.compact end |