Class: MCP::Resource::BlobContents

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

Instance Attribute Summary collapse

Attributes inherited from Contents

#mime_type, #uri

Instance Method Summary collapse

Constructor Details

#initialize(data:, uri:, mime_type:) ⇒ BlobContents

Returns a new instance of BlobContents.



34
35
36
37
# File 'lib/mcp/resource/contents.rb', line 34

def initialize(data:, uri:, mime_type:)
  super(uri: uri, mime_type: mime_type)
  @data = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



32
33
34
# File 'lib/mcp/resource/contents.rb', line 32

def data
  @data
end

Instance Method Details

#to_hObject



39
40
41
# File 'lib/mcp/resource/contents.rb', line 39

def to_h
  super.merge(data: data)
end