Method: Spider::TemplateBlocks::TextDomain#compile

Defined in:
lib/spiderfw/templates/blocks/text_domain.rb

#compile(options = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/spiderfw/templates/blocks/text_domain.rb', line 7

def compile(options={})
    init = ""
    td = @el.get_attribute('tpl:text-domain')
    c = "Spider::GetText.in_domain('#{td}') do\n"
    @el.remove_attribute('tpl:text-domain')
    content = Spider::TemplateBlocks.parse_element(@el, @allowed_blocks, @template).compile(options)
    init += content.init_code
    content.run_code.each_line do |line|
        c += '  '+line
    end
    c += "end\n"
    return CompiledBlock.new(init, c)
end