class Songbook::GenerateSongFiles

Attributes

input_path[R]
output_path[R]
verbose[R]

Public Class Methods

new(input_path:, output_path:, verbose: false) click to toggle source
# File lib/songbook/generate_song_files.rb, line 9
def initialize(input_path:, output_path:, verbose: false)
  @input_path = input_path
  @output_path = output_path
  @verbose = verbose
end

Public Instance Methods

call() click to toggle source
# File lib/songbook/generate_song_files.rb, line 15
def call
  Dir.glob("#{input_path}/*.yml") do |filename|
    basename = File.basename(filename, '.yml')

    output_file = "#{output_path}/#{basename}.txt"

    service = GenerateSongFile.new(
      input_path: filename,
      output_path: output_file,
      verbose: verbose
    )

    service.call
  end
end