Class: Textlint::Nodes::TxtParentNode
- Defined in:
- lib/textlint/nodes.rb
Overview
export interface TxtParentNode extends TxtNode
children: Array<TxtNode | TxtTextNode>;
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
Attributes inherited from TxtNode
Instance Method Summary collapse
- #as_textlint_json ⇒ Hash
-
#initialize(children: [], **attributes) ⇒ TxtParentNode
constructor
A new instance of TxtParentNode.
Constructor Details
#initialize(children: [], **attributes) ⇒ TxtParentNode
Returns a new instance of TxtParentNode.
133 134 135 136 |
# File 'lib/textlint/nodes.rb', line 133 def initialize(children: [], **attributes) @children = children super(**attributes) end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
130 131 132 |
# File 'lib/textlint/nodes.rb', line 130 def children @children end |
Instance Method Details
#as_textlint_json ⇒ Hash
139 140 141 142 143 |
# File 'lib/textlint/nodes.rb', line 139 def as_textlint_json h = super h[:children] = children.map(&:as_textlint_json) h end |