Class: AsciiMath::MathMLBuilder

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

Instance Method Summary collapse

Constructor Details

#initialize(prefix) ⇒ MathMLBuilder

Returns a new instance of MathMLBuilder.



3
4
5
6
# File 'lib/asciimath/mathml.rb', line 3

def initialize(prefix)
  @prefix = prefix
  @mathml = ''
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object (private)



100
101
102
# File 'lib/asciimath/mathml.rb', line 100

def method_missing(meth, *args, &block)
  tag(meth, *args, &block)
end

Instance Method Details

#append_expression(expression, attrs = {}) ⇒ Object



12
13
14
15
16
# File 'lib/asciimath/mathml.rb', line 12

def append_expression(expression, attrs = {})
  math('', attrs) do
    append(expression, :single_child => true)
  end
end

#to_sObject



8
9
10
# File 'lib/asciimath/mathml.rb', line 8

def to_s
  @mathml
end