class Rubydex::Skill
A skill file loaded from disk. Skill files are Markdown documents with YAML frontmatter that declare a name and description. The body is the Markdown content after the frontmatter.
Attributes
body
[R]
String
description
[R]
String
name
[R]
String
Public Class Methods
(String content, ?path: String?) → Rubydex::Skill
Source
# File lib/rubydex/skill.rb, line 27 def from_content(content, path: nil) new(**parse(content, path:)) end
(String path) → Rubydex::Skill
Source
# File lib/rubydex/skill.rb, line 20 def load(path) from_content(File.read(path), path:) rescue SystemCallError, IOError => e raise SkillError, "Cannot read skill file #{path}: #{e.message}" end
(name: String, description: String, body: String) → void
Source
# File lib/rubydex/skill.rb, line 81 def initialize(name:, description:, body:) @name = name.freeze @description = description.freeze @body = body.freeze freeze end