Sha256: bd407d93ae07b7c0fd5c7bf2f94794f65f69245ace609d3a4cac0345505e8c39
Contents?: true
Size: 785 Bytes
Versions: 36
Compression:
Stored size: 785 Bytes
Contents
require 'spiderfw/templates/template_blocks' module Spider; module TemplateBlocks # *sp:parent-context* # Executes the content using the parent's scene class ParentContext < Block def compile(options={}) init = "" c = "" # c += "debugger\n" parent_c, parent_init = compile_content(c, init, options) parent_c.gsub!("'", "\\\\'") #parent_init.gsub!("'", "\\\\'") init = parent_init init.gsub!('scene[', 'scene[:_parent][') c += "self[:_parent].instance_eval('def __run_block\n;#{parent_c}\nend\n')\n" c += "yield :_parent\n" return CompiledBlock.new(init, c) end end end; end
Version data entries
36 entries across 36 versions & 1 rubygems