abstract class
Components::Elements::VoidElement
Overview
Base class for void (self-closing) HTML elements These elements cannot have children and don't have closing tags
Direct Known Subclasses
- Components::Elements::Area
- Components::Elements::Base
- Components::Elements::Br
- Components::Elements::Col
- Components::Elements::Embed
- Components::Elements::Hr
- Components::Elements::Img
- Components::Elements::Input
- Components::Elements::Link
- Components::Elements::Meta
- Components::Elements::Param
- Components::Elements::Source
- Components::Elements::Track
- Components::Elements::Wbr
Defined in:
components/elements/base/void_element.crConstructors
Instance Method Summary
-
#<<(child : HTMLElement | String) : self
Void elements cannot have children
-
#add_child(child : HTMLElement | String) : self
Void elements cannot have children
-
#can_have_children? : Bool
Override to indicate void elements cannot have children
-
#render : String
Render the void element as a self-closing tag
-
#void_element? : Bool
Override to indicate this is a void element
Instance methods inherited from class Components::Elements::HTMLElement
[](name : String) : String | Nil
[],
add_class(class_names : String) : self
add_class,
add_style(styles : String) : self
add_style,
attributes : Hash(String, String)
attributes,
can_have_children? : Bool
can_have_children?,
children : Array(HTMLElement | String | RawHTML)
children,
has_class?(class_name : String) : Bool
has_class?,
remove_attribute(name : String) : self
remove_attribute,
remove_class(class_names : String) : self
remove_class,
render : String
render,
set_attribute(name : String, value : String | Nil) : self
set_attribute,
set_safe_style(style : SafeStyleValue) : self
set_safe_style,
set_safe_url_attribute(name : String, url : SafeURL) : self
set_safe_url_attribute,
tag_name : String
tag_name,
to_s(io : IO) : Nil
to_s,
void_element? : Bool
void_element?
Constructor methods inherited from class Components::Elements::HTMLElement
new(tag_name : String, **attrs)
new
Constructor Detail
Instance Method Detail
Void elements cannot have children