Class: Plurimath::Math::Function::Fenced

Inherits:
TernaryFunction show all
Defined in:
lib/plurimath/math/function/fenced.rb

Instance Attribute Summary

Attributes inherited from TernaryFunction

#parameter_one, #parameter_three, #parameter_two

Instance Method Summary collapse

Methods inherited from TernaryFunction

#==, #class_name, #initialize

Constructor Details

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

Instance Method Details

#to_asciimathObject



9
10
11
12
13
14
# File 'lib/plurimath/math/function/fenced.rb', line 9

def to_asciimath
  first_value  = parameter_one ? parameter_one.to_asciimath : "("
  second_value = parameter_two.map(&:to_asciimath).join(",") if parameter_two
  third_value  = parameter_three ? parameter_three.to_asciimath : ")"
  "#{first_value}#{second_value}#{third_value}"
end

#to_mathml_without_math_tagObject



16
17
18
# File 'lib/plurimath/math/function/fenced.rb', line 16

def to_mathml_without_math_tag
  "<mfenced open='#{parameter_one.value}' close='#{parameter_three.value}'>#{parameter_two.map(&:to_mathml_without_math_tag).join}</mfenced>"
end