Class: ModelContextProtocol::Server::ResourceTemplate::CompletionDSL
- Inherits:
-
Object
- Object
- ModelContextProtocol::Server::ResourceTemplate::CompletionDSL
- Defined in:
- lib/model_context_protocol/server/resource_template.rb
Instance Attribute Summary collapse
-
#completions ⇒ Object
readonly
Returns the value of attribute completions.
Instance Method Summary collapse
- #completion(param_name, completion_class_or_values) ⇒ Object
-
#initialize ⇒ CompletionDSL
constructor
A new instance of CompletionDSL.
Constructor Details
#initialize ⇒ CompletionDSL
Returns a new instance of CompletionDSL.
84 85 86 |
# File 'lib/model_context_protocol/server/resource_template.rb', line 84 def initialize @completions = {} end |
Instance Attribute Details
#completions ⇒ Object (readonly)
Returns the value of attribute completions.
82 83 84 |
# File 'lib/model_context_protocol/server/resource_template.rb', line 82 def completions @completions end |
Instance Method Details
#completion(param_name, completion_class_or_values) ⇒ Object
88 89 90 91 92 93 94 |
# File 'lib/model_context_protocol/server/resource_template.rb', line 88 def completion(param_name, completion_class_or_values) @completions[param_name.to_s] = if completion_class_or_values.is_a?(Array) create_array_completion(completion_class_or_values) else completion_class_or_values end end |