class Luce::Element
- Luce::Element
- Luce::Node
- Reference
- Object
Overview
A named tag that can contain other nodes.
Defined in:
luce/ast.crConstructors
-
.empty(tag : String) : Element
Initializes an empty, self-closing tag element.
-
.new(tag : String, children : Array(Node) | Nil)
Initializes a tag Element with children.
-
.text(tag : String, text : String) : Element
Initializes a tag Element with a single Text child.
-
.with_tag(tag : String) : Element
Initializes a tag Element with no
#children
.
Instance Method Summary
- #accept(visitor : NodeVisitor) : Nil
- #attributes : Hash(String, String)
- #children : Array(Node) | Nil
-
#empty? : Bool
Whether this element is self-closing.
- #generated_id : String | Nil
- #generated_id=(generated_id : String | Nil)
- #tag : String
- #text_content : String
Instance methods inherited from class Luce::Node
accept(visitor : NodeVisitor) : Nil
accept,
text_content : String
text_content
Constructor Detail
Initializes a tag Element with a single Text child.