Class: AgUiProtocol::Core::Events::RawEvent
- Inherits:
-
BaseEvent
- Object
- Types::Model
- BaseEvent
- AgUiProtocol::Core::Events::RawEvent
- Defined in:
- lib/ag_ui_protocol/core/events.rb
Overview
Used to pass through events from external systems.
“‘ruby event = AgUiProtocol::Core::Events::RawEvent.new(event: { “type” => “my_event”, “data” => { “a” => 1 } }, source: “my_source”) “`
Instance Attribute Summary collapse
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Attributes inherited from BaseEvent
Instance Method Summary collapse
-
#initialize(event:, source: nil, timestamp: nil, raw_event: nil) ⇒ RawEvent
constructor
A new instance of RawEvent.
- #to_h ⇒ Object
Methods inherited from Types::Model
Constructor Details
#initialize(event:, source: nil, timestamp: nil, raw_event: nil) ⇒ RawEvent
Returns a new instance of RawEvent.
784 785 786 787 788 |
# File 'lib/ag_ui_protocol/core/events.rb', line 784 def initialize(event:, source: nil, timestamp: nil, raw_event: nil) super(type: EventType::RAW, timestamp: , raw_event: raw_event) @event = event @source = source end |
Instance Attribute Details
#event ⇒ Object (readonly)
Returns the value of attribute event.
774 775 776 |
# File 'lib/ag_ui_protocol/core/events.rb', line 774 def event @event end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
777 778 779 |
# File 'lib/ag_ui_protocol/core/events.rb', line 777 def source @source end |
Instance Method Details
#to_h ⇒ Object
791 792 793 |
# File 'lib/ag_ui_protocol/core/events.rb', line 791 def to_h super.merge(event: @event, source: @source) end |