# File lib/rgen/template_language/template_container.rb, line 64 def self.const_missing(name) super unless @@metamodels @@metamodels.each do |mm| return mm.const_get(name) rescue NameError end super end
# File lib/rgen/template_language/template_container.rb, line 16 def initialize(metamodels, output_path, parent, filename) @templates = {} @parent = parent @filename = filename @indent = 0 @output_path = output_path @metamodels = metamodels @metamodels = [ @metamodels ] unless @metamodels.is_a?(Array) end
# File lib/rgen/template_language/template_container.rb, line 50 def evaluate(template, *all_args) args, params = _splitArgsAndOptions(all_args) raise StandardError.new(":foreach can not be used with evaluate") if params[:foreach] _expand(template, args, params.merge({:_evalOnly => true})) end
# File lib/rgen/template_language/template_container.rb, line 39 def expand(template, *all_args) args, params = _splitArgsAndOptions(all_args) if params.has_key?(:foreach) raise StandardError.new("expand :foreach argument is not enumerable") unless params[:foreach].is_a?(Enumerable) _expand_foreach(template, args, params) else _expand(template, args, params) end end
# File lib/rgen/template_language/template_container.rb, line 26 def load File.open(@filename,"rb") do |f| begin @@metamodels = @metamodels fileContent = f.read _detectNewLinePattern(fileContent) ERB.new(fileContent,nil,nil,'@output').result(binding) rescue Exception => e processAndRaise(e) end end end
Generated with the Darkfish Rdoc Generator 2.