class Luce::Element

Overview

A named tag that can contain other nodes.

Defined in:

luce/ast.cr

Constructors

Instance Method Summary

Instance methods inherited from class Luce::Node

accept(visitor : NodeVisitor) : Nil accept, text_content : String text_content

Constructor Detail

def self.empty(tag : String) : Element #

Initializes an empty, self-closing tag element.


def self.new(tag : String, children : Array(Node) | Nil) #

Initializes a tag Element with children.


def self.text(tag : String, text : String) : Element #

Initializes a tag Element with a single Text child.


def self.with_tag(tag : String) : Element #

Initializes a tag Element with no #children.


Instance Method Detail

def accept(visitor : NodeVisitor) : Nil #

def attributes : Hash(String, String) #

def children : Array(Node) | Nil #

def empty? : Bool #

Whether this element is self-closing.


def generated_id : String | Nil #

def generated_id=(generated_id : String | Nil) #

def tag : String #

def text_content : String #