Class: MCP::Resource::Embedded
- Inherits:
-
Object
- Object
- MCP::Resource::Embedded
- Defined in:
- lib/mcp/resource/embedded.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) ⇒ Embedded
constructor
A new instance of Embedded.
- #to_h ⇒ Object
Constructor Details
#initialize(resource:, annotations: nil) ⇒ Embedded
Returns a new instance of Embedded.
8 9 10 |
# File 'lib/mcp/resource/embedded.rb', line 8 def initialize(resource:, annotations: nil) @annotations = annotations end |
Instance Attribute Details
#annotations ⇒ Object (readonly)
Returns the value of attribute annotations.
6 7 8 |
# File 'lib/mcp/resource/embedded.rb', line 6 def annotations @annotations end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
6 7 8 |
# File 'lib/mcp/resource/embedded.rb', line 6 def resource @resource end |
Instance Method Details
#to_h ⇒ Object
12 13 14 |
# File 'lib/mcp/resource/embedded.rb', line 12 def to_h { resource: resource.to_h, annotations: }.compact end |