class Overapp::TemplateFile::VarObj

Attributes

file[RW]

Public Instance Methods

method_missing(sym,*args,&b) click to toggle source
# File lib/overapp/template_file/var_obj.rb, line 7
def method_missing(sym,*args,&b)
  if file.vars.has_key?(sym)
    file.vars[sym]
  elsif file.vars.has_key?(sym.to_s)
    file.vars[sym.to_s]
  else
    raise "not found #{sym}, options are #{file.vars.inspect}"
  end
end
render(body) click to toggle source
# File lib/overapp/template_file/var_obj.rb, line 17
def render(body)
  require 'erb'
  erb = ERB.new(body)
  erb.result(binding)
end