Class: Legion::Extensions::Agentic::Language::NarrativeReasoning::Helpers::NarrativeEvent
- Inherits:
-
Object
- Object
- Legion::Extensions::Agentic::Language::NarrativeReasoning::Helpers::NarrativeEvent
- Defined in:
- lib/legion/extensions/agentic/language/narrative_reasoning/helpers/narrative_event.rb
Instance Attribute Summary collapse
-
#causes ⇒ Object
readonly
Returns the value of attribute causes.
-
#characters ⇒ Object
readonly
Returns the value of attribute characters.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#event_type ⇒ Object
readonly
Returns the value of attribute event_type.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(content:, event_type:, characters: [], causes: [], domain: nil, id: nil, timestamp: nil) ⇒ NarrativeEvent
constructor
A new instance of NarrativeEvent.
- #to_h ⇒ Object
Constructor Details
#initialize(content:, event_type:, characters: [], causes: [], domain: nil, id: nil, timestamp: nil) ⇒ NarrativeEvent
Returns a new instance of NarrativeEvent.
14 15 16 17 18 19 20 21 22 |
# File 'lib/legion/extensions/agentic/language/narrative_reasoning/helpers/narrative_event.rb', line 14 def initialize(content:, event_type:, characters: [], causes: [], domain: nil, id: nil, timestamp: nil) @id = id || SecureRandom.uuid @content = content @event_type = event_type @characters = Array(characters).dup @causes = Array(causes).dup @domain = domain @timestamp = || Time.now.utc end |
Instance Attribute Details
#causes ⇒ Object (readonly)
Returns the value of attribute causes.
12 13 14 |
# File 'lib/legion/extensions/agentic/language/narrative_reasoning/helpers/narrative_event.rb', line 12 def causes @causes end |
#characters ⇒ Object (readonly)
Returns the value of attribute characters.
12 13 14 |
# File 'lib/legion/extensions/agentic/language/narrative_reasoning/helpers/narrative_event.rb', line 12 def characters @characters end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
12 13 14 |
# File 'lib/legion/extensions/agentic/language/narrative_reasoning/helpers/narrative_event.rb', line 12 def content @content end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
12 13 14 |
# File 'lib/legion/extensions/agentic/language/narrative_reasoning/helpers/narrative_event.rb', line 12 def domain @domain end |
#event_type ⇒ Object (readonly)
Returns the value of attribute event_type.
12 13 14 |
# File 'lib/legion/extensions/agentic/language/narrative_reasoning/helpers/narrative_event.rb', line 12 def event_type @event_type end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
12 13 14 |
# File 'lib/legion/extensions/agentic/language/narrative_reasoning/helpers/narrative_event.rb', line 12 def id @id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
12 13 14 |
# File 'lib/legion/extensions/agentic/language/narrative_reasoning/helpers/narrative_event.rb', line 12 def @timestamp end |
Instance Method Details
#to_h ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/legion/extensions/agentic/language/narrative_reasoning/helpers/narrative_event.rb', line 24 def to_h { id: @id, content: @content, event_type: @event_type, characters: @characters, causes: @causes, domain: @domain, timestamp: @timestamp } end |