Class: ReTemplate::Html
- Inherits:
-
ReTemplate
- Object
- ReTemplate
- ReTemplate::Html
- Defined in:
- lib/re_template/html.rb
Defined Under Namespace
Classes: SubTemplate
Instance Attribute Summary collapse
-
#doc ⇒ Object
Returns the value of attribute doc.
Attributes inherited from ReTemplate
Instance Method Summary collapse
Methods inherited from ReTemplate
Instance Attribute Details
#doc ⇒ Object
Returns the value of attribute doc.
4 5 6 |
# File 'lib/re_template/html.rb', line 4 def doc @doc end |
Instance Method Details
#parse!(given_doc) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/re_template/html.rb', line 5 def parse! given_doc if given_doc.kind_of? String self.doc = Nokogiri::HTML.parse(given_doc) else self.doc = given_doc.dup end self.nodes = [] parse_children! doc end |
#render(values) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/re_template/html.rb', line 17 def render values nodes.each do |node| node.render! values end doc.dup end |