Class: ModelContextProtocol::Resource::TextContents

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

Instance Attribute Summary collapse

Attributes inherited from Contents

#mime_type, #uri

Instance Method Summary collapse

Constructor Details

#initialize(text:, uri:, mime_type:) ⇒ TextContents

Returns a new instance of TextContents.



22
23
24
25
# File 'lib/model_context_protocol/resource/contents.rb', line 22

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

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



20
21
22
# File 'lib/model_context_protocol/resource/contents.rb', line 20

def text
  @text
end

Instance Method Details

#to_hObject



27
28
29
# File 'lib/model_context_protocol/resource/contents.rb', line 27

def to_h
  super.merge(text: text)
end