class FileProcesser

Public Class Methods

new(processFunc) click to toggle source
# File lib/file_processer.rb, line 21
def initialize(processFunc)
    @processFunc = processFunc
end

Public Instance Methods

process(filePath) click to toggle source
# File lib/file_processer.rb, line 25
def process(filePath)
    fileContent = File.read(filePath)
    result = @processFunc.call(fileContent)
    File.write(filePath, result)
end