Sha256: ed08cd9c39521e2b30ed81415355aad8479e4a16bf8e89afaea9d85aa5e1b441
Contents?: true
Size: 708 Bytes
Versions: 12
Compression:
Stored size: 708 Bytes
Contents
require 'spiderfw/templates/template_blocks' module Spider; module TemplateBlocks class Lambda < Block def compile(options={}) init = "" lambda_name = @el.attributes['sp:lambda'] @el.remove_attribute('sp:lambda') c = "#{lambda_name} = Proc.new do\n" content = Spider::TemplateBlocks.parse_element(@el, @allowed_blocks, @template).compile(options) content.run_code.each_line do |line| c += ' '+line end c += "end\n" c += "#{lambda_name}.call" return CompiledBlock.new(init, c) end end end; end
Version data entries
12 entries across 12 versions & 1 rubygems