Class: KairosMcp::EffectContext
- Inherits:
-
Object
- Object
- KairosMcp::EffectContext
- Defined in:
- lib/kairos_mcp/skill_contexts.rb
Overview
Effect block context
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#recordings ⇒ Object
readonly
Returns the value of attribute recordings.
-
#requirements ⇒ Object
readonly
Returns the value of attribute requirements.
-
#runner ⇒ Object
readonly
Returns the value of attribute runner.
Instance Method Summary collapse
-
#initialize(name) ⇒ EffectContext
constructor
A new instance of EffectContext.
- #records(what) ⇒ Object
- #requires(condition) ⇒ Object
- #run(&block) ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(name) ⇒ EffectContext
Returns a new instance of EffectContext.
24 25 26 27 28 29 |
# File 'lib/kairos_mcp/skill_contexts.rb', line 24 def initialize(name) @name = name @requirements = [] @recordings = [] @runner = nil end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
22 23 24 |
# File 'lib/kairos_mcp/skill_contexts.rb', line 22 def name @name end |
#recordings ⇒ Object (readonly)
Returns the value of attribute recordings.
22 23 24 |
# File 'lib/kairos_mcp/skill_contexts.rb', line 22 def recordings @recordings end |
#requirements ⇒ Object (readonly)
Returns the value of attribute requirements.
22 23 24 |
# File 'lib/kairos_mcp/skill_contexts.rb', line 22 def requirements @requirements end |
#runner ⇒ Object (readonly)
Returns the value of attribute runner.
22 23 24 |
# File 'lib/kairos_mcp/skill_contexts.rb', line 22 def runner @runner end |
Instance Method Details
#records(what) ⇒ Object
35 36 37 |
# File 'lib/kairos_mcp/skill_contexts.rb', line 35 def records(what) @recordings << what end |
#requires(condition) ⇒ Object
31 32 33 |
# File 'lib/kairos_mcp/skill_contexts.rb', line 31 def requires(condition) @requirements << condition end |
#run(&block) ⇒ Object
39 40 41 |
# File 'lib/kairos_mcp/skill_contexts.rb', line 39 def run(&block) @runner = block end |
#to_h ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'lib/kairos_mcp/skill_contexts.rb', line 43 def to_h { name: @name, requirements: @requirements, recordings: @recordings, has_runner: !@runner.nil? } end |