Class: Eclair::Element
- Inherits:
-
Object
- Object
- Eclair::Element
- Extended by:
- T::Helpers, T::Sig
- Defined in:
- lib/eclair/element.rb
Defined Under Namespace
Modules: Void Classes: DangerousUnescapedHtml
Constant Summary collapse
- AttributeValue =
T.type_alias { T.any(T::Boolean, String) }
- Attributes =
T.type_alias { T::Hash[Symbol, AttributeValue] }
- ElementChild =
T.type_alias { T.any(Element, String, DangerousUnescapedHtml) }
- Children =
T.type_alias { T.any(T.class_of(Void), T::Array[ElementChild]) }
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#tag ⇒ Object
readonly
Returns the value of attribute tag.
Instance Method Summary collapse
-
#initialize(tag:, attributes:, children:) ⇒ Element
constructor
A new instance of Element.
Constructor Details
#initialize(tag:, attributes:, children:) ⇒ Element
Returns a new instance of Element.
48 49 50 51 52 |
# File 'lib/eclair/element.rb', line 48 def initialize(tag:, attributes:, children:) @tag = tag @attributes = attributes @children = children end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
40 41 42 |
# File 'lib/eclair/element.rb', line 40 def attributes @attributes end |
#children ⇒ Object (readonly)
Returns the value of attribute children.
43 44 45 |
# File 'lib/eclair/element.rb', line 43 def children @children end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
37 38 39 |
# File 'lib/eclair/element.rb', line 37 def tag @tag end |