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.
22 23 24 25 26 |
# File 'lib/mcp/content.rb', line 22 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.
20 21 22 |
# File 'lib/mcp/content.rb', line 20 def annotations @annotations end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
20 21 22 |
# File 'lib/mcp/content.rb', line 20 def data @data end |
#mime_type ⇒ Object (readonly)
Returns the value of attribute mime_type.
20 21 22 |
# File 'lib/mcp/content.rb', line 20 def mime_type @mime_type end |
Instance Method Details
#to_h ⇒ Object
28 29 30 |
# File 'lib/mcp/content.rb', line 28 def to_h { data:, mime_type:, annotations:, type: "image" }.compact end |