class AsciiMath::AST::Matrix

Attributes

lparen[R]
rparen[R]

Public Class Methods

new(lparen, rows, rparen) click to toggle source
Calls superclass method AsciiMath::AST::InnerNode::new
# File lib/asciimath/ast.rb, line 405
def initialize(lparen, rows, rparen)
  super()
  @lparen = lparen
  @rparen = rparen
  rows.map { |row| MatrixRow.new(row) }.each { |row_seq| add(row_seq) }
end

Public Instance Methods

==(o) click to toggle source
# File lib/asciimath/ast.rb, line 419
def ==(o)
  o.class == self.class &&
      o.lparen == lparen &&
      o.child_nodes == child_nodes &&
      o.rparen == rparen
end
to_s() click to toggle source
# File lib/asciimath/ast.rb, line 412
def to_s
  s = ""
  s << (lparen.nil? ? '{:' : lparen.text)
  s << child_nodes.map { |node| node.to_s }.join(",")
  s << (rparen.nil? ? ':}' : rparen.text)
end