Class: Spider::TemplateBlocks::Tag

Inherits:
Block show all
Defined in:
lib/spiderfw/templates/blocks/tag.rb

Instance Attribute Summary

Attributes inherited from Block

#allowed_blocks, #doctype, #el, #template

Instance Method Summary collapse

Methods inherited from Block

#compile_content, #compile_text, #escape_text, #get_following, #initialize, #inspect, #parse_content, var_to_scene, #var_to_scene, #vars_to_scene, vars_to_scene

Constructor Details

This class inherits a constructor from Spider::TemplateBlocks::Block

Instance Method Details

#compile(options = {}) ⇒ Object



6
7
8
9
# File 'lib/spiderfw/templates/blocks/tag.rb', line 6

def compile(options={})
    block = Spider::TemplateBlocks.parse_element(process, @allowed_blocks, @template)
    return block.compile(options)
end

#processObject



11
12
13
14
15
# File 'lib/spiderfw/templates/blocks/tag.rb', line 11

def process
    klass = Spider::Template.get_registered_class(@el.name)
    tag = klass.new(@el)
    return Hpricot(tag.render).root
end