Class: HTML2AsciiMath::AST

Inherits:
Array
  • Object
show all
Defined in:
lib/html2asciimath/ast.rb

Overview

Abstract syntax tree implemented as array of arrays and other objects.

Defined Under Namespace

Modules: Refinements

Instance Method Summary collapse

Instance Method Details

#to_asciimath(child: false) ⇒ Object



18
19
20
21
# File 'lib/html2asciimath/ast.rb', line 18

def to_asciimath(child: false)
  result = map { |item| item.to_asciimath(child: true) }.join(" ")
  child && size > 1 ? "( #{result} )" : result
end