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



9
10
11
# File 'lib/mcp/resource/embedded.rb', line 9

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

Instance Attribute Details

#annotationsObject (readonly)

Returns the value of attribute annotations.



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

def annotations
  @annotations
end

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



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

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