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.



64
65
66
67
68
# File 'lib/mcp/content.rb', line 64

def initialize(resource, annotations: nil, meta: nil)
  @resource = resource
  @annotations = annotations
  @meta = meta
end

Instance Attribute Details

#annotations ⇒ Object (readonly)

Returns the value of attribute annotations.



62
63
64
# File 'lib/mcp/content.rb', line 62

def annotations
  @annotations
end

#meta ⇒ Object (readonly)

Returns the value of attribute meta.



62
63
64
# File 'lib/mcp/content.rb', line 62

def meta
  @meta
end

#resource ⇒ Object (readonly)

Returns the value of attribute resource.



62
63
64
# File 'lib/mcp/content.rb', line 62

def resource
  @resource
end

Instance Method Details

#to_h ⇒ Object



70
71
72
# File 'lib/mcp/content.rb', line 70

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