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.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
-
#initialize(resource, annotations: nil, meta: nil) ⇒ EmbeddedResource
constructor
A new instance of EmbeddedResource.
- #to_h ⇒ Object
Constructor Details
#initialize(resource, annotations: nil, meta: nil) ⇒ EmbeddedResource
Returns a new instance of EmbeddedResource.
52 53 54 55 56 |
# File 'lib/mcp/content.rb', line 52 def initialize(resource, annotations: nil, meta: nil) @resource = resource @annotations = annotations @meta = end |
Instance Attribute Details
#annotations ⇒ Object (readonly)
Returns the value of attribute annotations.
50 51 52 |
# File 'lib/mcp/content.rb', line 50 def annotations @annotations end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
50 51 52 |
# File 'lib/mcp/content.rb', line 50 def @meta end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
50 51 52 |
# File 'lib/mcp/content.rb', line 50 def resource @resource end |
Instance Method Details
#to_h ⇒ Object
58 59 60 |
# File 'lib/mcp/content.rb', line 58 def to_h { resource: resource.to_h, annotations: annotations, _meta: , type: "resource" }.compact end |