Class: MCP::ResourceTemplate
- Inherits:
-
Object
- Object
- MCP::ResourceTemplate
- Defined in:
- lib/mcp/resource_template.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#mime_type ⇒ Object
readonly
Returns the value of attribute mime_type.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#uri_template ⇒ Object
readonly
Returns the value of attribute uri_template.
Instance Method Summary collapse
-
#initialize(uri_template:, name:, title: nil, description: nil, mime_type: nil) ⇒ ResourceTemplate
constructor
A new instance of ResourceTemplate.
- #to_h ⇒ Object
Constructor Details
#initialize(uri_template:, name:, title: nil, description: nil, mime_type: nil) ⇒ ResourceTemplate
7 8 9 10 11 12 13 |
# File 'lib/mcp/resource_template.rb', line 7 def initialize(uri_template:, name:, title: nil, description: nil, mime_type: nil) @uri_template = uri_template @name = name @title = title @description = description @mime_type = mime_type end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
5 6 7 |
# File 'lib/mcp/resource_template.rb', line 5 def description @description end |
#mime_type ⇒ Object (readonly)
Returns the value of attribute mime_type.
5 6 7 |
# File 'lib/mcp/resource_template.rb', line 5 def mime_type @mime_type end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/mcp/resource_template.rb', line 5 def name @name end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/mcp/resource_template.rb', line 5 def title @title end |
#uri_template ⇒ Object (readonly)
Returns the value of attribute uri_template.
5 6 7 |
# File 'lib/mcp/resource_template.rb', line 5 def uri_template @uri_template end |
Instance Method Details
#to_h ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/mcp/resource_template.rb', line 15 def to_h { uriTemplate: uri_template, name: name, title: title, description: description, mimeType: mime_type, }.compact end |