class LaTeXProjectTemplate::Component

Attributes

path[R]

Public Class Methods

new(path) click to toggle source
# File lib/latex_project_template.rb, line 88
def initialize(path)
  @path = path
end

Public Instance Methods

evaluate(erb_obj) click to toggle source
# File lib/latex_project_template.rb, line 92
def evaluate(erb_obj)
  if /\.erb$/ =~ @path
    erb_obj.instance_exec(@path) do |path|
      erb = ERB.new(File.read(path))
      erb.result(binding)
    end
  else
    File.read(@path)
  end
end