Class: SimpleAcp::Models::MessagePartEvent
- Defined in:
- lib/simple_acp/models/events.rb
Overview
Message part event (for streaming individual parts)
Instance Attribute Summary
Attributes inherited from Event
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(**kwargs) ⇒ MessagePartEvent
constructor
A new instance of MessagePartEvent.
Methods inherited from Event
Methods inherited from Base
#==, attribute, attributes, #hash, own_attributes, #to_h, #to_json
Constructor Details
#initialize(**kwargs) ⇒ MessagePartEvent
Returns a new instance of MessagePartEvent.
48 49 50 51 |
# File 'lib/simple_acp/models/events.rb', line 48 def initialize(**kwargs) kwargs[:type] = Types::EventType::MESSAGE_PART super end |
Class Method Details
.from_hash(hash) ⇒ Object
53 54 55 56 57 58 59 60 61 |
# File 'lib/simple_acp/models/events.rb', line 53 def self.from_hash(hash) return nil if hash.nil? instance = super if hash["part"] || hash[:part] instance.part = MessagePart.from_hash(hash["part"] || hash[:part]) end instance end |