Class: MCP::Content::Audio

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, mime_type, annotations: nil, meta: nil) ⇒ Audio

Returns a new instance of Audio.



37
38
39
40
41
42
# File 'lib/mcp/content.rb', line 37

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

Instance Attribute Details

#annotationsObject (readonly)

Returns the value of attribute annotations.



35
36
37
# File 'lib/mcp/content.rb', line 35

def annotations
  @annotations
end

#dataObject (readonly)

Returns the value of attribute data.



35
36
37
# File 'lib/mcp/content.rb', line 35

def data
  @data
end

#metaObject (readonly)

Returns the value of attribute meta.



35
36
37
# File 'lib/mcp/content.rb', line 35

def meta
  @meta
end

#mime_typeObject (readonly)

Returns the value of attribute mime_type.



35
36
37
# File 'lib/mcp/content.rb', line 35

def mime_type
  @mime_type
end

Instance Method Details

#to_hObject



44
45
46
# File 'lib/mcp/content.rb', line 44

def to_h
  { data: data, mimeType: mime_type, annotations: annotations, _meta: meta, type: "audio" }.compact
end