Class: AsciiMath::HTMLBuilder

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

Instance Method Summary collapse

Constructor Details

#initialize(prefix) ⇒ HTMLBuilder

Returns a new instance of HTMLBuilder.



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

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

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



192
193
194
# File 'lib/asciimath/html.rb', line 192

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

Instance Method Details

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



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/asciimath/html.rb', line 12

def append_expression(expression, inline, attrs = {})
  if inline
    inline('', attrs) do
      append(expression, :single_child => true)
    end
  else
    block('', attrs) do
      append(expression, :single_child => true)
    end
  end
end

#to_sObject



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

def to_s
  @html
end