Class: Legion::Extensions::Agentic::Social::PerspectiveShifting::Helpers::Perspective
- Inherits:
-
Object
- Object
- Legion::Extensions::Agentic::Social::PerspectiveShifting::Helpers::Perspective
- Defined in:
- lib/legion/extensions/agentic/social/perspective_shifting/helpers/perspective.rb
Instance Attribute Summary collapse
-
#bias_toward ⇒ Object
readonly
Returns the value of attribute bias_toward.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#empathy_level ⇒ Object
readonly
Returns the value of attribute empathy_level.
-
#expertise_domains ⇒ Object
readonly
Returns the value of attribute expertise_domains.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#perspective_type ⇒ Object
readonly
Returns the value of attribute perspective_type.
-
#priorities ⇒ Object
readonly
Returns the value of attribute priorities.
Instance Method Summary collapse
-
#initialize(name:, perspective_type:, priorities: [], expertise_domains: [], empathy_level: Constants::DEFAULT_EMPATHY, bias_toward: nil) ⇒ Perspective
constructor
A new instance of Perspective.
- #to_h ⇒ Object
Constructor Details
#initialize(name:, perspective_type:, priorities: [], expertise_domains: [], empathy_level: Constants::DEFAULT_EMPATHY, bias_toward: nil) ⇒ Perspective
Returns a new instance of Perspective.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/legion/extensions/agentic/social/perspective_shifting/helpers/perspective.rb', line 15 def initialize(name:, perspective_type:, priorities: [], expertise_domains: [], empathy_level: Constants::DEFAULT_EMPATHY, bias_toward: nil) @id = SecureRandom.uuid @name = name @perspective_type = perspective_type @priorities = Array(priorities) @expertise_domains = Array(expertise_domains) @empathy_level = empathy_level.clamp(0.0, 1.0) @bias_toward = bias_toward @created_at = Time.now.utc end |
Instance Attribute Details
#bias_toward ⇒ Object (readonly)
Returns the value of attribute bias_toward.
12 13 14 |
# File 'lib/legion/extensions/agentic/social/perspective_shifting/helpers/perspective.rb', line 12 def bias_toward @bias_toward end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
12 13 14 |
# File 'lib/legion/extensions/agentic/social/perspective_shifting/helpers/perspective.rb', line 12 def created_at @created_at end |
#empathy_level ⇒ Object (readonly)
Returns the value of attribute empathy_level.
12 13 14 |
# File 'lib/legion/extensions/agentic/social/perspective_shifting/helpers/perspective.rb', line 12 def empathy_level @empathy_level end |
#expertise_domains ⇒ Object (readonly)
Returns the value of attribute expertise_domains.
12 13 14 |
# File 'lib/legion/extensions/agentic/social/perspective_shifting/helpers/perspective.rb', line 12 def expertise_domains @expertise_domains end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
12 13 14 |
# File 'lib/legion/extensions/agentic/social/perspective_shifting/helpers/perspective.rb', line 12 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/legion/extensions/agentic/social/perspective_shifting/helpers/perspective.rb', line 12 def name @name end |
#perspective_type ⇒ Object (readonly)
Returns the value of attribute perspective_type.
12 13 14 |
# File 'lib/legion/extensions/agentic/social/perspective_shifting/helpers/perspective.rb', line 12 def perspective_type @perspective_type end |
#priorities ⇒ Object (readonly)
Returns the value of attribute priorities.
12 13 14 |
# File 'lib/legion/extensions/agentic/social/perspective_shifting/helpers/perspective.rb', line 12 def priorities @priorities end |
Instance Method Details
#to_h ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/legion/extensions/agentic/social/perspective_shifting/helpers/perspective.rb', line 27 def to_h { id: @id, name: @name, perspective_type: @perspective_type, priorities: @priorities, expertise_domains: @expertise_domains, empathy_level: @empathy_level.round(10), bias_toward: @bias_toward, created_at: @created_at } end |