Class: MCP::Content::Image
- Inherits:
-
Object
- Object
- MCP::Content::Image
- Defined in:
- lib/mcp/content.rb
Instance Attribute Summary collapse
-
#annotations ⇒ Object
readonly
Returns the value of attribute annotations.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#mime_type ⇒ Object
readonly
Returns the value of attribute mime_type.
Instance Method Summary collapse
-
#initialize(data, mime_type, annotations: nil) ⇒ Image
constructor
A new instance of Image.
- #to_h ⇒ Object
Constructor Details
#initialize(data, mime_type, annotations: nil) ⇒ Image
Returns a new instance of Image.
21 22 23 24 25 |
# File 'lib/mcp/content.rb', line 21 def initialize(data, mime_type, annotations: nil) @data = data @mime_type = mime_type @annotations = annotations end |
Instance Attribute Details
#annotations ⇒ Object (readonly)
Returns the value of attribute annotations.
19 20 21 |
# File 'lib/mcp/content.rb', line 19 def annotations @annotations end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
19 20 21 |
# File 'lib/mcp/content.rb', line 19 def data @data end |
#mime_type ⇒ Object (readonly)
Returns the value of attribute mime_type.
19 20 21 |
# File 'lib/mcp/content.rb', line 19 def mime_type @mime_type end |
Instance Method Details
#to_h ⇒ Object
27 28 29 |
# File 'lib/mcp/content.rb', line 27 def to_h { data:, mime_type:, annotations:, type: "image" }.compact end |