Class: MCP::Content::EmbeddedResource

Inherits:
Object
  • Object
show all
Defined in:
lib/mcp/content.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#annotationsObject (readonly)

Returns the value of attribute annotations.



47
48
49
# File 'lib/mcp/content.rb', line 47

def annotations
  @annotations
end

#resourceObject (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_hObject



54
55
56
# File 'lib/mcp/content.rb', line 54

def to_h
  { resource: resource.to_h, annotations: annotations, type: "resource" }.compact
end