lib/plurimath/math/function/frac.rb in plurimath-0.2.0 vs lib/plurimath/math/function/frac.rb in plurimath-0.2.1
- old
+ new
@@ -5,17 +5,17 @@
module Plurimath
module Math
module Function
class Frac < BinaryFunction
def to_mathml_without_math_tag
- first_value = parameter_one.to_mathml_without_math_tag if parameter_one
- two_value = parameter_two.to_mathml_without_math_tag if parameter_two
+ first_value = parameter_one&.to_mathml_without_math_tag
+ two_value = parameter_two&.to_mathml_without_math_tag
"<mfrac>#{first_value}#{two_value}</mfrac>"
end
def to_latex
- first_value = parameter_one.to_latex if parameter_one
- two_value = parameter_two.to_latex if parameter_two
+ first_value = parameter_one&.to_latex
+ two_value = parameter_two&.to_latex
"\\frac{#{first_value}}{#{two_value}}"
end
end
end
end