class Mech::Compiler::Format
Public Class Methods
new(*args)
click to toggle source
# File lib/mech/compiler/format.rb, line 11 def initialize(*args) @data = {} end
Public Instance Methods
compile(data, params = {}, &block)
click to toggle source
# File lib/mech/compiler/format.rb, line 7 def compile(data, params = {}, &block) raise 'Compile method not exist' end
output()
click to toggle source
# File lib/mech/compiler/format.rb, line 23 def output @data end
tmp_path()
click to toggle source
# File lib/mech/compiler/format.rb, line 19 def tmp_path raise 'Not defined tmp path' end
with_template()
click to toggle source
# File lib/mech/compiler/format.rb, line 15 def with_template ERB.new(File.read(tmp_path)).result(binding) end