Class: AgUiProtocol::Core::Events::ActivityDeltaEvent
- Inherits:
-
BaseEvent
- Object
- Types::Model
- BaseEvent
- AgUiProtocol::Core::Events::ActivityDeltaEvent
- Defined in:
- lib/ag_ui_protocol/core/events.rb
Overview
Provides incremental updates to an activity snapshot using JSON Patch.
“‘ruby event = AgUiProtocol::Core::Events::ActivityDeltaEvent.new(message_id: “m1”, activity_type: “PLAN”, patch: [{ “op” => “replace”, “path” => “/a”, “value” => 2 }]) “`
Instance Attribute Summary collapse
-
#activity_type ⇒ Object
readonly
Returns the value of attribute activity_type.
-
#message_id ⇒ Object
readonly
Returns the value of attribute message_id.
-
#patch ⇒ Object
readonly
Returns the value of attribute patch.
Attributes inherited from BaseEvent
Instance Method Summary collapse
-
#initialize(message_id:, activity_type:, patch:, timestamp: nil, raw_event: nil) ⇒ ActivityDeltaEvent
constructor
A new instance of ActivityDeltaEvent.
- #to_h ⇒ Object
Methods inherited from Types::Model
Constructor Details
#initialize(message_id:, activity_type:, patch:, timestamp: nil, raw_event: nil) ⇒ ActivityDeltaEvent
Returns a new instance of ActivityDeltaEvent.
748 749 750 751 752 753 |
# File 'lib/ag_ui_protocol/core/events.rb', line 748 def initialize(message_id:, activity_type:, patch:, timestamp: nil, raw_event: nil) super(type: EventType::ACTIVITY_DELTA, timestamp: , raw_event: raw_event) @message_id = @activity_type = activity_type @patch = patch end |
Instance Attribute Details
#activity_type ⇒ Object (readonly)
Returns the value of attribute activity_type.
737 738 739 |
# File 'lib/ag_ui_protocol/core/events.rb', line 737 def activity_type @activity_type end |
#message_id ⇒ Object (readonly)
Returns the value of attribute message_id.
734 735 736 |
# File 'lib/ag_ui_protocol/core/events.rb', line 734 def @message_id end |
#patch ⇒ Object (readonly)
Returns the value of attribute patch.
740 741 742 |
# File 'lib/ag_ui_protocol/core/events.rb', line 740 def patch @patch end |
Instance Method Details
#to_h ⇒ Object
756 757 758 759 760 761 762 |
# File 'lib/ag_ui_protocol/core/events.rb', line 756 def to_h super.merge( message_id: @message_id, activity_type: @activity_type, patch: @patch ) end |