Class: Riffer::Skills::Backend
- Inherits:
-
Object
- Object
- Riffer::Skills::Backend
- Defined in:
- lib/riffer/skills/backend.rb
Overview
Interface for skill storage backends. Subclass and implement list_skills and read_skill for custom storage (database, S3, etc.); use Riffer::Skills::Frontmatter.parse on raw SKILL.md content.
Direct Known Subclasses
Constant Summary collapse
- SKILL_FILENAME =
: String
"SKILL.md"
Instance Method Summary collapse
-
#initialize ⇒ Backend
constructor
A new instance of Backend.
-
#list_skills ⇒ Object
Returns frontmatter for all available skills; called once at the start of generate/stream.
-
#read_skill(name) ⇒ Object
Returns the full SKILL.md body (without frontmatter) for a skill.
Constructor Details
#initialize ⇒ Backend
Returns a new instance of Backend.
10 |
# File 'lib/riffer/skills/backend.rb', line 10 def initialize = nil |
Instance Method Details
#list_skills ⇒ Object
Returns frontmatter for all available skills; called once at the start of generate/stream. – : () -> Array
16 17 18 |
# File 'lib/riffer/skills/backend.rb', line 16 def list_skills raise NotImplementedError, "#{self.class} must implement #list_skills" end |
#read_skill(name) ⇒ Object
Returns the full SKILL.md body (without frontmatter) for a skill. Raises Riffer::ArgumentError if the skill is not found. – : (String) -> String
24 25 26 |
# File 'lib/riffer/skills/backend.rb', line 24 def read_skill(name) raise NotImplementedError, "#{self.class} must implement #read_skill" end |