Class: MCP::Prompt::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/mcp/prompt/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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
  @messages = messages
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



6
7
8
# File 'lib/mcp/prompt/result.rb', line 6

def description
  @description
end

#messagesObject (readonly)

Returns the value of attribute messages.



6
7
8
# File 'lib/mcp/prompt/result.rb', line 6

def messages
  @messages
end

Instance Method Details

#to_hObject



13
14
15
# File 'lib/mcp/prompt/result.rb', line 13

def to_h
  { description:, messages: messages.map(&:to_h) }.compact
end