Class: Ace::Handbook::Models::SkillDocument

Inherits:
Object
  • Object
show all
Defined in:
lib/ace/handbook/models/skill_document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject (readonly)

Returns the value of attribute body.



7
8
9
# File 'lib/ace/handbook/models/skill_document.rb', line 7

def body
  @body
end

#frontmatterObject (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_pathObject (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

#nameObject



15
16
17
# File 'lib/ace/handbook/models/skill_document.rb', line 15

def name
  frontmatter.fetch("name")
end

#sourceObject



19
20
21
# File 'lib/ace/handbook/models/skill_document.rb', line 19

def source
  frontmatter.fetch("source", "unknown").to_s
end