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, 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 = meta
end

Instance Attribute Details

#annotationsObject (readonly)

Returns the value of attribute annotations.



50
51
52
# File 'lib/mcp/content.rb', line 50

def annotations
  @annotations
end

#metaObject (readonly)

Returns the value of attribute meta.



50
51
52
# File 'lib/mcp/content.rb', line 50

def meta
  @meta
end

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



58
59
60
# File 'lib/mcp/content.rb', line 58

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