Class: SkillBench::Services::ContextLoaderService
- Inherits:
-
Object
- Object
- SkillBench::Services::ContextLoaderService
- Defined in:
- lib/skill_bench/services/context_loader_service.rb
Overview
Loads and combines skill context from SKILL.md files.
Class Method Summary collapse
-
.call(skills) ⇒ String
Loads and combines skill context from SKILL.md files.
Instance Method Summary collapse
-
#call ⇒ String
Loads and combines skill context from SKILL.md files.
-
#initialize(skills) ⇒ ContextLoaderService
constructor
A new instance of ContextLoaderService.
Constructor Details
#initialize(skills) ⇒ ContextLoaderService
Returns a new instance of ContextLoaderService.
16 17 18 |
# File 'lib/skill_bench/services/context_loader_service.rb', line 16 def initialize(skills) @skills = skills end |
Class Method Details
.call(skills) ⇒ String
Loads and combines skill context from SKILL.md files.
11 12 13 |
# File 'lib/skill_bench/services/context_loader_service.rb', line 11 def self.call(skills) new(skills).call end |
Instance Method Details
#call ⇒ String
Loads and combines skill context from SKILL.md files.
23 24 25 26 27 28 |
# File 'lib/skill_bench/services/context_loader_service.rb', line 23 def call return '' if @skills.nil? || @skills.empty? contexts = @skills.map { |skill| load_skill_context(skill) } contexts.reject(&:empty?).join("\n\n#{'=' * 40}\n\n") end |