Class: RubyCoded::Commands::MarkdownLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_coded/commands/markdown_loader.rb

Overview

Loads project-local markdown command files.

Instance Method Summary collapse

Constructor Details

#initialize(project_root:) ⇒ MarkdownLoader

Returns a new instance of MarkdownLoader.



9
10
11
# File 'lib/ruby_coded/commands/markdown_loader.rb', line 9

def initialize(project_root:)
  @project_root = project_root
end

Instance Method Details

#load_filesObject



13
14
15
# File 'lib/ruby_coded/commands/markdown_loader.rb', line 13

def load_files
  load_report[:entries]
end

#load_reportObject



17
18
19
20
21
# File 'lib/ruby_coded/commands/markdown_loader.rb', line 17

def load_report
  return empty_report unless Dir.exist?(commands_dir)

  build_report(command_paths)
end