Class: ClaudeSDK::ContentBlock::Text
- Inherits:
-
Object
- Object
- ClaudeSDK::ContentBlock::Text
- Defined in:
- lib/claude_sdk/types.rb
Overview
Text content block
Instance Attribute Summary collapse
-
#text ⇒ Object
the text content.
Instance Method Summary collapse
-
#initialize(text:) ⇒ Text
constructor
A new instance of Text.
-
#to_h ⇒ Hash
Serialized representation.
Constructor Details
#initialize(text:) ⇒ Text
Returns a new instance of Text.
129 130 131 |
# File 'lib/claude_sdk/types.rb', line 129 def initialize(text:) @text = text end |
Instance Attribute Details
#text ⇒ Object
the text content
125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/claude_sdk/types.rb', line 125 class Text attr_accessor :text # @param text [String] the text content def initialize(text:) @text = text end # @return [Hash] serialized representation def to_h { type: "text", text: text } end end |
Instance Method Details
#to_h ⇒ Hash
Returns serialized representation.
134 135 136 |
# File 'lib/claude_sdk/types.rb', line 134 def to_h { type: "text", text: text } end |