Class: ModelContextProtocol::Server::Content::EmbeddedResource
- Inherits:
-
Data
- Object
- Data
- ModelContextProtocol::Server::Content::EmbeddedResource
- Defined in:
- lib/model_context_protocol/server/content.rb
Instance Attribute Summary collapse
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
Instance Attribute Details
#meta ⇒ Object (readonly)
Returns the value of attribute meta
155 156 157 |
# File 'lib/model_context_protocol/server/content.rb', line 155 def @meta end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource
155 156 157 |
# File 'lib/model_context_protocol/server/content.rb', line 155 def resource @resource end |
Instance Method Details
#serialized ⇒ Object
156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/model_context_protocol/server/content.rb', line 156 def serialized serialized_data = { _meta: , resource:, type: "resource" }.compact validation_errors = JSON::Validator.fully_validate(schema, serialized_data) if validation_errors.empty? serialized_data else raise ContentValidationError, validation_errors.join(", ") end end |