Class: MCP::Prompt::Argument

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, title: nil, description: nil, required: false) ⇒ Argument

Returns a new instance of Argument.



8
9
10
11
12
13
# File 'lib/mcp/prompt/argument.rb', line 8

def initialize(name:, title: nil, description: nil, required: false)
  @name = name
  @title = title
  @description = description
  @required = required
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#requiredObject (readonly)

Returns the value of attribute required.



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

def required
  @required
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

Instance Method Details

#to_hObject



15
16
17
18
19
20
21
22
# File 'lib/mcp/prompt/argument.rb', line 15

def to_h
  {
    name: name,
    title: title,
    description: description,
    required: required,
  }.compact
end