Class: Legion::Extensions::Agentic::Executive::Inhibition::Helpers::Impulse
- Inherits:
-
Object
- Object
- Legion::Extensions::Agentic::Executive::Inhibition::Helpers::Impulse
- Defined in:
- lib/legion/extensions/agentic/executive/inhibition/helpers/impulse.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#strength ⇒ Object
readonly
Returns the value of attribute strength.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #auto_suppressible? ⇒ Boolean
-
#initialize(type:, action:, strength:, source: nil, context: {}) ⇒ Impulse
constructor
A new instance of Impulse.
- #overwhelming? ⇒ Boolean
Constructor Details
#initialize(type:, action:, strength:, source: nil, context: {}) ⇒ Impulse
Returns a new instance of Impulse.
14 15 16 17 18 19 20 21 22 |
# File 'lib/legion/extensions/agentic/executive/inhibition/helpers/impulse.rb', line 14 def initialize(type:, action:, strength:, source: nil, context: {}) @id = SecureRandom.uuid @type = type @action = action @strength = strength @source = source @context = context @created_at = Time.now.utc end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
12 13 14 |
# File 'lib/legion/extensions/agentic/executive/inhibition/helpers/impulse.rb', line 12 def action @action end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
12 13 14 |
# File 'lib/legion/extensions/agentic/executive/inhibition/helpers/impulse.rb', line 12 def context @context end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
12 13 14 |
# File 'lib/legion/extensions/agentic/executive/inhibition/helpers/impulse.rb', line 12 def created_at @created_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
12 13 14 |
# File 'lib/legion/extensions/agentic/executive/inhibition/helpers/impulse.rb', line 12 def id @id end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
12 13 14 |
# File 'lib/legion/extensions/agentic/executive/inhibition/helpers/impulse.rb', line 12 def source @source end |
#strength ⇒ Object (readonly)
Returns the value of attribute strength.
12 13 14 |
# File 'lib/legion/extensions/agentic/executive/inhibition/helpers/impulse.rb', line 12 def strength @strength end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
12 13 14 |
# File 'lib/legion/extensions/agentic/executive/inhibition/helpers/impulse.rb', line 12 def type @type end |
Instance Method Details
#auto_suppressible? ⇒ Boolean
28 29 30 |
# File 'lib/legion/extensions/agentic/executive/inhibition/helpers/impulse.rb', line 28 def auto_suppressible? @strength <= Constants::AUTOMATIC_SUPPRESS_THRESHOLD end |
#overwhelming? ⇒ Boolean
24 25 26 |
# File 'lib/legion/extensions/agentic/executive/inhibition/helpers/impulse.rb', line 24 def overwhelming? @strength >= Constants::IMPULSE_STRENGTHS[:strong] end |