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.
9 10 11 |
# File 'lib/mcp/resource/embedded.rb', line 9 def initialize(resource:, annotations: nil) @annotations = annotations end |
Instance Attribute Details
#annotations ⇒ Object (readonly)
Returns the value of attribute annotations.
7 8 9 |
# File 'lib/mcp/resource/embedded.rb', line 7 def annotations @annotations end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
7 8 9 |
# File 'lib/mcp/resource/embedded.rb', line 7 def resource @resource end |
Instance Method Details
#to_h ⇒ Object
13 14 15 |
# File 'lib/mcp/resource/embedded.rb', line 13 def to_h { resource: resource.to_h, annotations: }.compact end |