class Polites::Node

The Node is the basic building block of the AST we parse Polites document contents into.

Attributes

children[R]

@return [Array<Node>]

Public Class Methods

new(children = []) click to toggle source

@param [Array<Node>] children

# File lib/polites/node.rb, line 11
def initialize(children = [])
  @children = children
end

Public Instance Methods

==(other)
Alias for: eql?
eql?(other) click to toggle source
# File lib/polites/node.rb, line 22
def eql?(other)
  other.is_a?(self.class) && children.eql?(other.children)
end
Also aliased as: ==
text() click to toggle source

Assemble the text contents of this node and all its children combined.

@return [String]

# File lib/polites/node.rb, line 18
def text
  @children.map(&:text).join
end