Class: MCP::Resource::TextContents
- Defined in:
- lib/mcp/resource/contents.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Attributes inherited from Contents
Instance Method Summary collapse
-
#initialize(text:, uri:, mime_type:) ⇒ TextContents
constructor
A new instance of TextContents.
- #to_h ⇒ Object
Constructor Details
#initialize(text:, uri:, mime_type:) ⇒ TextContents
Returns a new instance of TextContents.
21 22 23 24 |
# File 'lib/mcp/resource/contents.rb', line 21 def initialize(text:, uri:, mime_type:) super(uri: uri, mime_type: mime_type) @text = text end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
19 20 21 |
# File 'lib/mcp/resource/contents.rb', line 19 def text @text end |
Instance Method Details
#to_h ⇒ Object
26 27 28 |
# File 'lib/mcp/resource/contents.rb', line 26 def to_h super.merge(text: text) end |