Class: AgUiProtocol::Core::Events::StateSnapshotEvent
- Inherits:
-
BaseEvent
- Object
- Types::Model
- BaseEvent
- AgUiProtocol::Core::Events::StateSnapshotEvent
- Defined in:
- lib/ag_ui_protocol/core/events.rb
Overview
Provides a complete snapshot of an agent’s state.
“‘ruby event = AgUiProtocol::Core::Events::StateSnapshotEvent.new(snapshot: { “a” => 1 }) “`
Instance Attribute Summary collapse
-
#snapshot ⇒ Object
readonly
Returns the value of attribute snapshot.
Attributes inherited from BaseEvent
Instance Method Summary collapse
-
#initialize(snapshot:, timestamp: nil, raw_event: nil) ⇒ StateSnapshotEvent
constructor
A new instance of StateSnapshotEvent.
- #to_h ⇒ Object
Methods inherited from Types::Model
Constructor Details
#initialize(snapshot:, timestamp: nil, raw_event: nil) ⇒ StateSnapshotEvent
Returns a new instance of StateSnapshotEvent.
603 604 605 606 |
# File 'lib/ag_ui_protocol/core/events.rb', line 603 def initialize(snapshot:, timestamp: nil, raw_event: nil) super(type: EventType::STATE_SNAPSHOT, timestamp: , raw_event: raw_event) @snapshot = snapshot end |
Instance Attribute Details
#snapshot ⇒ Object (readonly)
Returns the value of attribute snapshot.
597 598 599 |
# File 'lib/ag_ui_protocol/core/events.rb', line 597 def snapshot @snapshot end |
Instance Method Details
#to_h ⇒ Object
609 610 611 |
# File 'lib/ag_ui_protocol/core/events.rb', line 609 def to_h super.merge(snapshot: @snapshot) end |