Class: Textlint::Nodes::TxtParentNode

Inherits:
TxtNode
  • Object
show all
Defined in:
lib/textlint/nodes.rb

Overview

export interface TxtParentNode extends TxtNode

children: Array<TxtNode | TxtTextNode>;

Instance Attribute Summary collapse

Attributes inherited from TxtNode

#loc, #range, #raw, #type

Instance Method Summary collapse

Constructor Details

#initialize(children: [], **attributes) ⇒ TxtParentNode

Returns a new instance of TxtParentNode.

Parameters:



133
134
135
136
# File 'lib/textlint/nodes.rb', line 133

def initialize(children: [], **attributes)
  @children = children
  super(**attributes)
end

Instance Attribute Details

#childrenObject (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_jsonHash

Returns:

  • (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