Class: Ace::Handbook::Models::SkillDocument
- Inherits:
-
Object
- Object
- Ace::Handbook::Models::SkillDocument
- Defined in:
- lib/ace/handbook/models/skill_document.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#frontmatter ⇒ Object
readonly
Returns the value of attribute frontmatter.
-
#source_path ⇒ Object
readonly
Returns the value of attribute source_path.
Instance Method Summary collapse
-
#initialize(source_path:, frontmatter:, body:) ⇒ SkillDocument
constructor
A new instance of SkillDocument.
- #name ⇒ Object
- #source ⇒ Object
Constructor Details
#initialize(source_path:, frontmatter:, body:) ⇒ SkillDocument
Returns a new instance of SkillDocument.
9 10 11 12 13 |
# File 'lib/ace/handbook/models/skill_document.rb', line 9 def initialize(source_path:, frontmatter:, body:) @source_path = source_path @frontmatter = frontmatter @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
7 8 9 |
# File 'lib/ace/handbook/models/skill_document.rb', line 7 def body @body end |
#frontmatter ⇒ Object (readonly)
Returns the value of attribute frontmatter.
7 8 9 |
# File 'lib/ace/handbook/models/skill_document.rb', line 7 def frontmatter @frontmatter end |
#source_path ⇒ Object (readonly)
Returns the value of attribute source_path.
7 8 9 |
# File 'lib/ace/handbook/models/skill_document.rb', line 7 def source_path @source_path end |
Instance Method Details
#name ⇒ Object
15 16 17 |
# File 'lib/ace/handbook/models/skill_document.rb', line 15 def name frontmatter.fetch("name") end |
#source ⇒ Object
19 20 21 |
# File 'lib/ace/handbook/models/skill_document.rb', line 19 def source frontmatter.fetch("source", "unknown").to_s end |