Class: Plurimath::Math::Function::Tr

Inherits:
UnaryFunction show all
Defined in:
lib/plurimath/math/function/tr.rb

Instance Attribute Summary

Attributes inherited from UnaryFunction

#parameter_one

Instance Method Summary collapse

Methods inherited from UnaryFunction

#==, #class_name, #initialize, #value_to_asciimath

Constructor Details

This class inherits a constructor from Plurimath::Math::Function::UnaryFunction

Instance Method Details

#to_asciimathObject



9
10
11
# File 'lib/plurimath/math/function/tr.rb', line 9

def to_asciimath
  "[#{parameter_one.map(&:to_asciimath).join(',')}]"
end

#to_htmlObject



23
24
25
26
# File 'lib/plurimath/math/function/tr.rb', line 23

def to_html
  first_value = parameter_one.map(&:to_html).join
  "<tr>#{first_value}</tr>"
end

#to_latexObject



17
18
19
20
21
# File 'lib/plurimath/math/function/tr.rb', line 17

def to_latex
  parameter_one.reject do |td|
    td if td.is_a?(Math::Symbol) && td.value == "|"
  end.map(&:to_latex).join("&")
end

#to_mathml_without_math_tagObject



13
14
15
# File 'lib/plurimath/math/function/tr.rb', line 13

def to_mathml_without_math_tag
  "<mtr>#{parameter_one.map(&:to_mathml_without_math_tag).join}</mtr>"
end