Class: MCP::Prompt::Result
- Inherits:
-
Object
- Object
- MCP::Prompt::Result
- Defined in:
- lib/mcp/prompt/result.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
Instance Method Summary collapse
-
#initialize(description: nil, messages: []) ⇒ Result
constructor
A new instance of Result.
- #to_h ⇒ Object
Constructor Details
#initialize(description: nil, messages: []) ⇒ Result
8 9 10 11 |
# File 'lib/mcp/prompt/result.rb', line 8 def initialize(description: nil, messages: []) @description = description = end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
6 7 8 |
# File 'lib/mcp/prompt/result.rb', line 6 def description @description end |
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
6 7 8 |
# File 'lib/mcp/prompt/result.rb', line 6 def end |
Instance Method Details
#to_h ⇒ Object
13 14 15 |
# File 'lib/mcp/prompt/result.rb', line 13 def to_h { description:, messages: .map(&:to_h) }.compact end |