Class: MCP::Content::Text
- Inherits:
-
Object
- Object
- MCP::Content::Text
- Defined in:
- lib/mcp/content.rb
Instance Attribute Summary collapse
-
#annotations ⇒ Object
readonly
Returns the value of attribute annotations.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text, annotations: nil) ⇒ Text
constructor
A new instance of Text.
- #to_h ⇒ Object
Constructor Details
#initialize(text, annotations: nil) ⇒ Text
Returns a new instance of Text.
8 9 10 11 |
# File 'lib/mcp/content.rb', line 8 def initialize(text, annotations: nil) @text = text @annotations = annotations end |
Instance Attribute Details
#annotations ⇒ Object (readonly)
Returns the value of attribute annotations.
6 7 8 |
# File 'lib/mcp/content.rb', line 6 def annotations @annotations end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
6 7 8 |
# File 'lib/mcp/content.rb', line 6 def text @text end |
Instance Method Details
#to_h ⇒ Object
13 14 15 |
# File 'lib/mcp/content.rb', line 13 def to_h { text:, annotations:, type: "text" }.compact end |