Class: Copilot::SessionEvent
- Inherits:
-
Struct
- Object
- Struct
- Copilot::SessionEvent
- Defined in:
- lib/copilot/types.rb
Overview
Session event from the server. Uses an open struct-style approach so new event types are forward-compatible.
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#ephemeral ⇒ Object
Returns the value of attribute ephemeral.
-
#id ⇒ Object
Returns the value of attribute id.
-
#parent_id ⇒ Object
Returns the value of attribute parent_id.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data
459 460 461 |
# File 'lib/copilot/types.rb', line 459 def data @data end |
#ephemeral ⇒ Object
Returns the value of attribute ephemeral
459 460 461 |
# File 'lib/copilot/types.rb', line 459 def ephemeral @ephemeral end |
#id ⇒ Object
Returns the value of attribute id
459 460 461 |
# File 'lib/copilot/types.rb', line 459 def id @id end |
#parent_id ⇒ Object
Returns the value of attribute parent_id
459 460 461 |
# File 'lib/copilot/types.rb', line 459 def parent_id @parent_id end |
#timestamp ⇒ Object
Returns the value of attribute timestamp
459 460 461 |
# File 'lib/copilot/types.rb', line 459 def @timestamp end |
#type ⇒ Object
Returns the value of attribute type
459 460 461 |
# File 'lib/copilot/types.rb', line 459 def type @type end |
Class Method Details
.from_hash(h) ⇒ Object
460 461 462 463 464 465 466 467 468 469 |
# File 'lib/copilot/types.rb', line 460 def self.from_hash(h) new( id: h["id"], timestamp: h["timestamp"], parent_id: h["parentId"], ephemeral: h["ephemeral"], type: h["type"], data: h["data"] || {} ) end |