Sha256: 0aefe7593cf01818f79d3295b580433d3fc3671abb546d8a15bedc460db1134f
Contents?: true
Size: 784 Bytes
Versions: 11
Compression:
Stored size: 784 Bytes
Contents
require 'spiderfw/templates/template_blocks' module Spider; module TemplateBlocks class TagIf < Block def compile(options={}) init = "" cond = vars_to_scene(@el.get_attribute('sp:tag-if')) @el.remove_attribute('sp:tag-if') html = HTML.new(@el, @template) c = "if (#{cond})\n" c += html.get_start(options) c += "end\n" c, init = html.compile_content(c, init, options) tag_end = html.get_end if (tag_end) c += "if (#{cond})\n" c += " $out << '#{tag_end}'\n" c += "end\n" end return CompiledBlock.new(init, c) end end end; end
Version data entries
11 entries across 11 versions & 1 rubygems