Class: MCP::Resource::Embedded

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#annotationsObject (readonly)

Returns the value of attribute annotations.



6
7
8
# File 'lib/mcp/resource/embedded.rb', line 6

def annotations
  @annotations
end

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



12
13
14
# File 'lib/mcp/resource/embedded.rb', line 12

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