Class: ModelContextProtocol::Server::Content::ResourceLink
- Inherits:
-
Data
- Object
- Data
- ModelContextProtocol::Server::Content::ResourceLink
- Defined in:
- lib/model_context_protocol/server/content.rb
Instance Attribute Summary collapse
-
#annotations ⇒ Object
readonly
Returns the value of attribute annotations.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#mime_type ⇒ Object
readonly
Returns the value of attribute mime_type.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
Instance Attribute Details
#annotations ⇒ Object (readonly)
Returns the value of attribute annotations
196 197 198 |
# File 'lib/model_context_protocol/server/content.rb', line 196 def annotations @annotations end |
#description ⇒ Object (readonly)
Returns the value of attribute description
196 197 198 |
# File 'lib/model_context_protocol/server/content.rb', line 196 def description @description end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta
196 197 198 |
# File 'lib/model_context_protocol/server/content.rb', line 196 def @meta end |
#mime_type ⇒ Object (readonly)
Returns the value of attribute mime_type
196 197 198 |
# File 'lib/model_context_protocol/server/content.rb', line 196 def mime_type @mime_type end |
#name ⇒ Object (readonly)
Returns the value of attribute name
196 197 198 |
# File 'lib/model_context_protocol/server/content.rb', line 196 def name @name end |
#size ⇒ Object (readonly)
Returns the value of attribute size
196 197 198 |
# File 'lib/model_context_protocol/server/content.rb', line 196 def size @size end |
#title ⇒ Object (readonly)
Returns the value of attribute title
196 197 198 |
# File 'lib/model_context_protocol/server/content.rb', line 196 def title @title end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri
196 197 198 |
# File 'lib/model_context_protocol/server/content.rb', line 196 def uri @uri end |
Instance Method Details
#serialized ⇒ Object
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
# File 'lib/model_context_protocol/server/content.rb', line 197 def serialized serialized_data = { _meta: , annotations:, description:, mimeType: mime_type, name:, size:, title:, type: "resource_link", uri: }.compact validation_errors = JSON::Validator.fully_validate(schema, serialized_data) if validation_errors.empty? serialized_data else raise ContentValidationError, validation_errors.join(", ") end end |