Class: ModelContextProtocol::Server::Prompt::DefinitionDSL
- Inherits:
-
Object
- Object
- ModelContextProtocol::Server::Prompt::DefinitionDSL
- Defined in:
- lib/model_context_protocol/server/prompt.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
Instance Method Summary collapse
- #argument(&block) ⇒ Object
- #description(value = nil) ⇒ Object
-
#initialize ⇒ DefinitionDSL
constructor
A new instance of DefinitionDSL.
- #name(value = nil) ⇒ Object
- #title(value = nil) ⇒ Object
Constructor Details
#initialize ⇒ DefinitionDSL
Returns a new instance of DefinitionDSL.
145 146 147 |
# File 'lib/model_context_protocol/server/prompt.rb', line 145 def initialize @arguments = [] end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
143 144 145 |
# File 'lib/model_context_protocol/server/prompt.rb', line 143 def arguments @arguments end |
Instance Method Details
#argument(&block) ⇒ Object
164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/model_context_protocol/server/prompt.rb', line 164 def argument(&block) argument_dsl = ArgumentDSL.new argument_dsl.instance_eval(&block) @arguments << { name: argument_dsl.name, description: argument_dsl.description, required: argument_dsl.required, completion: argument_dsl.completion } end |
#description(value = nil) ⇒ Object
154 155 156 157 |
# File 'lib/model_context_protocol/server/prompt.rb', line 154 def description(value = nil) @description = value if value @description end |
#name(value = nil) ⇒ Object
149 150 151 152 |
# File 'lib/model_context_protocol/server/prompt.rb', line 149 def name(value = nil) @name = value if value @name end |
#title(value = nil) ⇒ Object
159 160 161 162 |
# File 'lib/model_context_protocol/server/prompt.rb', line 159 def title(value = nil) @title = value if value @title end |