Class: AsciiMath::Expression

Inherits:
Object
  • Object
show all
Defined in:
lib/asciimath/html.rb,
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.



578
579
580
581
# File 'lib/asciimath/parser.rb', line 578

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

Instance Method Details

#to_html(prefix = "", inline = true, attrs = {}) ⇒ Object



230
231
232
# File 'lib/asciimath/html.rb', line 230

def to_html(prefix = "", inline = true, attrs = {})
  HTMLBuilder.new(prefix).append_expression(@parsed_expression, inline, attrs).to_s
end

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



139
140
141
# File 'lib/asciimath/mathml.rb', line 139

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

#to_sObject



583
584
585
# File 'lib/asciimath/parser.rb', line 583

def to_s
  @asciimath
end