Class: ClaudeSDK::Messages::User
- Inherits:
-
Object
- Object
- ClaudeSDK::Messages::User
- Defined in:
- lib/claude_sdk/types.rb
Overview
User message
Instance Attribute Summary collapse
-
#content ⇒ Object
the message content.
Instance Method Summary collapse
-
#initialize(content:) ⇒ User
constructor
A new instance of User.
-
#to_h ⇒ Hash
Serialized representation.
Constructor Details
#initialize(content:) ⇒ User
Returns a new instance of User.
198 199 200 |
# File 'lib/claude_sdk/types.rb', line 198 def initialize(content:) @content = content end |
Instance Attribute Details
#content ⇒ Object
the message content
194 195 196 197 198 199 200 201 202 203 204 205 206 |
# File 'lib/claude_sdk/types.rb', line 194 class User attr_accessor :content # @param content [String] the message content def initialize(content:) @content = content end # @return [Hash] serialized representation def to_h { role: "user", content: content } end end |
Instance Method Details
#to_h ⇒ Hash
Returns serialized representation.
203 204 205 |
# File 'lib/claude_sdk/types.rb', line 203 def to_h { role: "user", content: content } end |