Class: AgUiProtocol::Core::Events::StateDeltaEvent
- Inherits:
-
BaseEvent
- Object
- Types::Model
- BaseEvent
- AgUiProtocol::Core::Events::StateDeltaEvent
- Defined in:
- lib/ag_ui_protocol/core/events.rb
Overview
Provides a partial update to an agent’s state using JSON Patch.
“‘ruby event = AgUiProtocol::Core::Events::StateDeltaEvent.new(delta: [{ “op” => “replace”, “path” => “/a”, “value” => 2 }]) “`
Instance Attribute Summary collapse
-
#delta ⇒ Object
readonly
Returns the value of attribute delta.
Attributes inherited from BaseEvent
Instance Method Summary collapse
-
#initialize(delta:, timestamp: nil, raw_event: nil) ⇒ StateDeltaEvent
constructor
A new instance of StateDeltaEvent.
- #to_h ⇒ Object
Methods inherited from Types::Model
Constructor Details
#initialize(delta:, timestamp: nil, raw_event: nil) ⇒ StateDeltaEvent
Returns a new instance of StateDeltaEvent.
629 630 631 632 |
# File 'lib/ag_ui_protocol/core/events.rb', line 629 def initialize(delta:, timestamp: nil, raw_event: nil) super(type: EventType::STATE_DELTA, timestamp: , raw_event: raw_event) @delta = delta end |
Instance Attribute Details
#delta ⇒ Object (readonly)
Returns the value of attribute delta.
623 624 625 |
# File 'lib/ag_ui_protocol/core/events.rb', line 623 def delta @delta end |
Instance Method Details
#to_h ⇒ Object
635 636 637 |
# File 'lib/ag_ui_protocol/core/events.rb', line 635 def to_h super.merge(delta: @delta) end |