Sha256: fd27344fbda4ada18efaf08e3e4df243fa362ec7f195d728727ade6d1ccfdb75

Contents?: true

Size: 1.2 KB

Versions: 2

Compression:

Stored size: 1.2 KB

Contents

# frozen_string_literal: true

require_relative "binary_function"

module Plurimath
  module Math
    module Function
      class Menclose < BinaryFunction
        def to_asciimath
          parameter_two&.to_asciimath
        end

        def to_mathml_without_math_tag
          attributes = { notation: parameter_one }
          menclose = Utility.ox_element("menclose", attributes: attributes)
          menclose << parameter_two.to_mathml_without_math_tag if parameter_two
          menclose
        end

        def to_latex
          parameter_two&.to_latex
        end

        def to_html
          second_value = parameter_two&.to_html
          "<menclose notation=\"#{parameter_one}\">#{second_value}</menclose>"
        end

        def to_omml_without_math_tag
          borderbox = Utility.ox_element("borderBox", namespace: "m")
          borderpr = Utility.ox_element("borderBoxPr", namespace: "m")
          borderpr << Utility.pr_element("ctrl", true, namespace: "m")
          Utility.update_nodes(
            borderbox,
            [
              borderpr,
              omml_parameter(parameter_two, tag_name: "e"),
            ],
          )
          [borderbox]
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
plurimath-0.3.9 lib/plurimath/math/function/menclose.rb
plurimath-0.3.8 lib/plurimath/math/function/menclose.rb