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.
154 155 156 |
# File 'lib/model_context_protocol/server/prompt.rb', line 154 def initialize @arguments = [] end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
152 153 154 |
# File 'lib/model_context_protocol/server/prompt.rb', line 152 def arguments @arguments end |
Instance Method Details
#argument(&block) ⇒ Object
173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/model_context_protocol/server/prompt.rb', line 173 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
163 164 165 166 |
# File 'lib/model_context_protocol/server/prompt.rb', line 163 def description(value = nil) @description = value if value @description end |
#name(value = nil) ⇒ Object
158 159 160 161 |
# File 'lib/model_context_protocol/server/prompt.rb', line 158 def name(value = nil) @name = value if value @name end |
#title(value = nil) ⇒ Object
168 169 170 171 |
# File 'lib/model_context_protocol/server/prompt.rb', line 168 def title(value = nil) @title = value if value @title end |