Class: AsciiMath::AST::Sequence

Inherits:
InnerNode show all
Defined in:
lib/asciimath/ast.rb

Instance Attribute Summary

Attributes inherited from Node

#parent

Instance Method Summary collapse

Methods inherited from InnerNode

#[], #each, #length

Constructor Details

#initialize(nodes) ⇒ Sequence

Returns a new instance of Sequence.



121
122
123
124
# File 'lib/asciimath/ast.rb', line 121

def initialize(nodes)
  super()
  nodes.each { |node| add(node) }
end

Instance Method Details

#==(o) ⇒ Object



130
131
132
# File 'lib/asciimath/ast.rb', line 130

def ==(o)
  o.class == self.class && o.child_nodes == child_nodes
end

#to_sObject



126
127
128
# File 'lib/asciimath/ast.rb', line 126

def to_s
  child_nodes.map { |node| node.to_s }.join(" ")
end