Class: Lapillus::Webpage
- Defined in:
- lib/lapillus/containers.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Container
Attributes inherited from Component
#behaviours, #identifier, #model, #property, #visible
Instance Method Summary collapse
- #default_htmlfile ⇒ Object
-
#initialize ⇒ Webpage
constructor
A new instance of Webpage.
- #render_2(template = default_htmlfile) ⇒ Object (also: #render)
Methods inherited from Container
#[], #add, add_component, #component, fileuploadfield, image, label, listview, panel, password_textfield, #post, #render_children, textarea, textfield
Methods inherited from Component
#add_behaviour, #behaviour, #has_behaviour?, #has_model?, #has_parent?, #parent, #path, #response_page=, #session, #value, #webpage
Methods inherited from RenderableComponent
#on_render, #render_behaviours, #render_children, #render_component, #render_container, #render_to_element, #visible?
Constructor Details
#initialize ⇒ Webpage
Returns a new instance of Webpage.
40 41 42 |
# File 'lib/lapillus/containers.rb', line 40 def initialize() super("") end |
Instance Method Details
#default_htmlfile ⇒ Object
53 54 55 56 |
# File 'lib/lapillus/containers.rb', line 53 def default_htmlfile htmlfile = "html/" + self.class.to_s + ".html" File.new( htmlfile ) end |
#render_2(template = default_htmlfile) ⇒ Object Also known as: render
44 45 46 47 48 49 50 |
# File 'lib/lapillus/containers.rb', line 44 def render_2(template=default_htmlfile) doc = REXML::Document.new template root_element = doc.root visitor = HtmlVisitor.new(self) root_element.accept(visitor) return doc.doctype.to_s + visitor.container_output.root.to_s.gsub(''',"'").gsub('"','"') end |