Class: Legion::Extensions::Agentic::Language::ConceptualBlending::Helpers::MentalSpace
- Inherits:
-
Object
- Object
- Legion::Extensions::Agentic::Language::ConceptualBlending::Helpers::MentalSpace
- Defined in:
- lib/legion/extensions/agentic/language/conceptual_blending/helpers/mental_space.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#elements ⇒ Object
readonly
Returns the value of attribute elements.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#relations ⇒ Object
readonly
Returns the value of attribute relations.
Instance Method Summary collapse
- #add_element(name:, properties: {}) ⇒ Object
- #add_relation(from:, to:, type:) ⇒ Object
- #element_names ⇒ Object
-
#initialize(name:, domain:) ⇒ MentalSpace
constructor
A new instance of MentalSpace.
- #to_h ⇒ Object
Constructor Details
#initialize(name:, domain:) ⇒ MentalSpace
Returns a new instance of MentalSpace.
12 13 14 15 16 17 18 19 |
# File 'lib/legion/extensions/agentic/language/conceptual_blending/helpers/mental_space.rb', line 12 def initialize(name:, domain:) @id = ::SecureRandom.uuid @name = name @domain = domain @elements = {} @relations = [] @created_at = Time.now.utc end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
10 11 12 |
# File 'lib/legion/extensions/agentic/language/conceptual_blending/helpers/mental_space.rb', line 10 def created_at @created_at end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
10 11 12 |
# File 'lib/legion/extensions/agentic/language/conceptual_blending/helpers/mental_space.rb', line 10 def domain @domain end |
#elements ⇒ Object (readonly)
Returns the value of attribute elements.
10 11 12 |
# File 'lib/legion/extensions/agentic/language/conceptual_blending/helpers/mental_space.rb', line 10 def elements @elements end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/legion/extensions/agentic/language/conceptual_blending/helpers/mental_space.rb', line 10 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/legion/extensions/agentic/language/conceptual_blending/helpers/mental_space.rb', line 10 def name @name end |
#relations ⇒ Object (readonly)
Returns the value of attribute relations.
10 11 12 |
# File 'lib/legion/extensions/agentic/language/conceptual_blending/helpers/mental_space.rb', line 10 def relations @relations end |
Instance Method Details
#add_element(name:, properties: {}) ⇒ Object
21 22 23 24 |
# File 'lib/legion/extensions/agentic/language/conceptual_blending/helpers/mental_space.rb', line 21 def add_element(name:, properties: {}) @elements[name] = properties self end |
#add_relation(from:, to:, type:) ⇒ Object
26 27 28 29 |
# File 'lib/legion/extensions/agentic/language/conceptual_blending/helpers/mental_space.rb', line 26 def add_relation(from:, to:, type:) @relations << { from: from, to: to, type: type } self end |
#element_names ⇒ Object
31 32 33 |
# File 'lib/legion/extensions/agentic/language/conceptual_blending/helpers/mental_space.rb', line 31 def element_names @elements.keys end |
#to_h ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/legion/extensions/agentic/language/conceptual_blending/helpers/mental_space.rb', line 35 def to_h { id: @id, name: @name, domain: @domain, elements: @elements, relations: @relations, created_at: @created_at } end |