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.
9 10 11 12 |
# File 'lib/mcp/content.rb', line 9 def initialize(text, annotations: nil) @text = text @annotations = annotations end |
Instance Attribute Details
#annotations ⇒ Object (readonly)
Returns the value of attribute annotations.
7 8 9 |
# File 'lib/mcp/content.rb', line 7 def annotations @annotations end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
7 8 9 |
# File 'lib/mcp/content.rb', line 7 def text @text end |
Instance Method Details
#to_h ⇒ Object
14 15 16 |
# File 'lib/mcp/content.rb', line 14 def to_h { text:, annotations:, type: "text" }.compact end |