Class: MCP::Content::EmbeddedResource
- Inherits:
-
Object
- Object
- MCP::Content::EmbeddedResource
- Defined in:
- lib/mcp/content.rb
Instance Attribute Summary collapse
-
#annotations ⇒ Object
readonly
Returns the value of attribute annotations.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
-
#initialize(resource, annotations: nil) ⇒ EmbeddedResource
constructor
A new instance of EmbeddedResource.
- #to_h ⇒ Object
Constructor Details
#initialize(resource, annotations: nil) ⇒ EmbeddedResource
Returns a new instance of EmbeddedResource.
49 50 51 52 |
# File 'lib/mcp/content.rb', line 49 def initialize(resource, annotations: nil) @resource = resource @annotations = annotations end |
Instance Attribute Details
#annotations ⇒ Object (readonly)
Returns the value of attribute annotations.
47 48 49 |
# File 'lib/mcp/content.rb', line 47 def annotations @annotations end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
47 48 49 |
# File 'lib/mcp/content.rb', line 47 def resource @resource end |
Instance Method Details
#to_h ⇒ Object
54 55 56 |
# File 'lib/mcp/content.rb', line 54 def to_h { resource: resource.to_h, annotations: annotations, type: "resource" }.compact end |