Class: AgUiProtocol::Core::Events::CustomEvent
- Inherits:
-
BaseEvent
- Object
- Types::Model
- BaseEvent
- AgUiProtocol::Core::Events::CustomEvent
- Defined in:
- lib/ag_ui_protocol/core/events.rb
Overview
Used for application-specific custom events.
“‘ruby event = AgUiProtocol::Core::Events::CustomEvent.new(name: “my_event”, value: { “a” => 1 }) “`
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from BaseEvent
Instance Method Summary collapse
-
#initialize(name:, value:, timestamp: nil, raw_event: nil) ⇒ CustomEvent
constructor
A new instance of CustomEvent.
- #to_h ⇒ Object
Methods inherited from Types::Model
Constructor Details
#initialize(name:, value:, timestamp: nil, raw_event: nil) ⇒ CustomEvent
Returns a new instance of CustomEvent.
815 816 817 818 819 |
# File 'lib/ag_ui_protocol/core/events.rb', line 815 def initialize(name:, value:, timestamp: nil, raw_event: nil) super(type: EventType::CUSTOM, timestamp: , raw_event: raw_event) @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
805 806 807 |
# File 'lib/ag_ui_protocol/core/events.rb', line 805 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
808 809 810 |
# File 'lib/ag_ui_protocol/core/events.rb', line 808 def value @value end |
Instance Method Details
#to_h ⇒ Object
822 823 824 |
# File 'lib/ag_ui_protocol/core/events.rb', line 822 def to_h super.merge(name: @name, value: @value) end |