Class: AsciiMath::Expression

Inherits:
Object
  • Object
show all
Defined in:
lib/asciimath/mathml.rb,
lib/asciimath/parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(asciimath, parsed_expression) ⇒ Expression

Returns a new instance of Expression.



540
541
542
543
# File 'lib/asciimath/parser.rb', line 540

def initialize(asciimath, parsed_expression)
  @asciimath = asciimath
  @parsed_expression = parsed_expression
end

Instance Method Details

#to_mathml(prefix = "", attrs = {}) ⇒ Object



127
128
129
# File 'lib/asciimath/mathml.rb', line 127

def to_mathml(prefix = "", attrs = {})
  MathMLBuilder.new(prefix).append_expression(@parsed_expression, attrs).to_s
end

#to_sObject



545
546
547
# File 'lib/asciimath/parser.rb', line 545

def to_s
  @asciimath
end