class Packtory::Packer::TemplateFile
Public Class Methods
new(packer, file_path, tvalues)
click to toggle source
# File lib/packtory/packer.rb, line 427 def initialize(packer, file_path, tvalues) @packer = packer @file_path = file_path @tvalues = tvalues end
Public Instance Methods
concat(str)
click to toggle source
# File lib/packtory/packer.rb, line 442 def concat(str) @output_buffer << str end
evaluate!()
click to toggle source
# File lib/packtory/packer.rb, line 433 def evaluate! erb = ERB.new(File.read(@file_path), nil, '-', '@output_buffer') File.write(@file_path, erb.result(binding)) @file_path end
packer()
click to toggle source
# File lib/packtory/packer.rb, line 440 def packer; @packer; end
Private Instance Methods
method_missing(k, *args)
click to toggle source
Calls superclass method
# File lib/packtory/packer.rb, line 448 def method_missing(k, *args) if @tvalues.nil? super elsif @tvalues.include?(k.to_s) @tvalues[k.to_s] elsif @tvalues.include?(k) @tvalues[k] else super end end