Class: ModelContextProtocol::Server::Content::Annotations
- Inherits:
-
Data
- Object
- Data
- ModelContextProtocol::Server::Content::Annotations
- Defined in:
- lib/model_context_protocol/server/content.rb
Instance Attribute Summary collapse
-
#audience ⇒ Object
readonly
Returns the value of attribute audience.
-
#last_modified ⇒ Object
readonly
Returns the value of attribute last_modified.
-
#priority ⇒ Object
readonly
Returns the value of attribute priority.
Instance Method Summary collapse
Instance Attribute Details
#audience ⇒ Object (readonly)
Returns the value of attribute audience
267 268 269 |
# File 'lib/model_context_protocol/server/content.rb', line 267 def audience @audience end |
#last_modified ⇒ Object (readonly)
Returns the value of attribute last_modified
267 268 269 |
# File 'lib/model_context_protocol/server/content.rb', line 267 def last_modified @last_modified end |
#priority ⇒ Object (readonly)
Returns the value of attribute priority
267 268 269 |
# File 'lib/model_context_protocol/server/content.rb', line 267 def priority @priority end |
Instance Method Details
#serialized ⇒ Object
268 269 270 271 272 273 274 275 276 277 |
# File 'lib/model_context_protocol/server/content.rb', line 268 def serialized serialized_data = {audience:, lastModified: last_modified, priority:}.compact validation_errors = JSON::Validator.fully_validate(schema, serialized_data) unless validation_errors.empty? raise ContentValidationError, validation_errors.join(", ") end serialized_data.empty? ? nil : serialized_data end |