Class: Events::UserMessage
Constant Summary collapse
- TYPE =
"user_message"
Instance Attribute Summary collapse
-
#status ⇒ String?
readonly
“pending” when queued during active processing, nil otherwise.
Attributes inherited from Base
#content, #session_id, #timestamp
Instance Method Summary collapse
-
#initialize(content:, session_id: nil, status: nil) ⇒ UserMessage
constructor
A new instance of UserMessage.
- #to_h ⇒ Object
- #type ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(content:, session_id: nil, status: nil) ⇒ UserMessage
Returns a new instance of UserMessage.
13 14 15 16 |
# File 'lib/events/user_message.rb', line 13 def initialize(content:, session_id: nil, status: nil) super(content: content, session_id: session_id) @status = status end |
Instance Attribute Details
#status ⇒ String? (readonly)
Returns “pending” when queued during active processing, nil otherwise.
8 9 10 |
# File 'lib/events/user_message.rb', line 8 def status @status end |
Instance Method Details
#to_h ⇒ Object
22 23 24 25 26 |
# File 'lib/events/user_message.rb', line 22 def to_h h = super h[:status] = status if status h end |
#type ⇒ Object
18 19 20 |
# File 'lib/events/user_message.rb', line 18 def type TYPE end |