Class: HTree::TemplateCompiler::TemplateNode
- Inherits:
-
Object
- Object
- HTree::TemplateCompiler::TemplateNode
- Includes:
- Node
- Defined in:
- lib/htree/template.rb
Constant Summary
Constants included from HTree
DefaultContext, ElementContent, ElementExclusions, ElementInclusions, EmptyBindingObject, HTMLContext, NamedCharacters, NamedCharactersPattern, OmittedAttrName
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
Instance Method Summary collapse
-
#initialize(*children) ⇒ TemplateNode
constructor
A new instance of TemplateNode.
- #output(out, context) ⇒ Object
Methods included from Node
#display_html, #display_xml, #eliminate_raw_string, #extract_text, #generate_xml_output_code, #make_loc, #raw_string, #subst, #subst_internal, #to_node, #to_rexml
Methods included from HTree
#==, build_node, #check_equality, compile_template, #exact_equal?, #exact_equal_object, expand_template, fix_element, fix_structure_list, frozen_string, #hash, #make_exact_equal_object, #make_usual_equal_object, parse, parse_as, parse_pairs, parse_xml, scan, #usual_equal_object, with_frozen_string_hash
Constructor Details
#initialize(*children) ⇒ TemplateNode
Returns a new instance of TemplateNode.
934 935 936 |
# File 'lib/htree/template.rb', line 934 def initialize(*children) @children = children.flatten.compact end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
937 938 939 |
# File 'lib/htree/template.rb', line 937 def children @children end |
Instance Method Details
#output(out, context) ⇒ Object
939 940 941 942 943 944 945 946 947 |
# File 'lib/htree/template.rb', line 939 def output(out, context) @children.each {|c| if c.respond_to? :call c.call(out, context) else c.output(out, context) end } end |