Class: ModelContextProtocol::Server::ResourceTemplate::DefinitionDSL
- Inherits:
-
Object
- Object
- ModelContextProtocol::Server::ResourceTemplate::DefinitionDSL
- 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
- #description(value = nil) ⇒ Object
-
#initialize ⇒ DefinitionDSL
constructor
A new instance of DefinitionDSL.
- #mime_type(value = nil) ⇒ Object
- #name(value = nil) ⇒ Object
- #uri_template(value = nil, &block) ⇒ Object
Constructor Details
#initialize ⇒ DefinitionDSL
Returns a new instance of DefinitionDSL.
49 50 51 |
# File 'lib/model_context_protocol/server/resource_template.rb', line 49 def initialize @completions = {} end |
Instance Attribute Details
#completions ⇒ Object (readonly)
Returns the value of attribute completions.
47 48 49 |
# File 'lib/model_context_protocol/server/resource_template.rb', line 47 def completions @completions end |
Instance Method Details
#description(value = nil) ⇒ Object
58 59 60 61 |
# File 'lib/model_context_protocol/server/resource_template.rb', line 58 def description(value = nil) @description = value if value @description end |
#mime_type(value = nil) ⇒ Object
63 64 65 66 |
# File 'lib/model_context_protocol/server/resource_template.rb', line 63 def mime_type(value = nil) @mime_type = value if value @mime_type end |
#name(value = nil) ⇒ Object
53 54 55 56 |
# File 'lib/model_context_protocol/server/resource_template.rb', line 53 def name(value = nil) @name = value if value @name end |
#uri_template(value = nil, &block) ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/model_context_protocol/server/resource_template.rb', line 68 def uri_template(value = nil, &block) @uri_template = value if value if block_given? completion_dsl = CompletionDSL.new completion_dsl.instance_eval(&block) @completions = completion_dsl.completions end @uri_template end |