Sha256: f11dc3c5c919d8ef75117744cc330af83df0c9cc17b0bb5849e2cf239503abef

Contents?: true

Size: 1.26 KB

Versions: 15

Compression:

Stored size: 1.26 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")
          me = Utility.ox_element("e", namespace: "m")
          me << parameter_two.to_omml_without_math_tag if parameter_two
          Utility.update_nodes(
            borderbox,
            [
              borderpr,
              me,
            ],
          )
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
plurimath-0.3.5 lib/plurimath/math/function/menclose.rb
plurimath-0.3.4 lib/plurimath/math/function/menclose.rb
plurimath-0.3.3 lib/plurimath/math/function/menclose.rb
plurimath-0.3.2 lib/plurimath/math/function/menclose.rb
plurimath-0.3.1.2 lib/plurimath/math/function/menclose.rb
plurimath-0.3.1 lib/plurimath/math/function/menclose.rb
plurimath-0.3.0 lib/plurimath/math/function/menclose.rb
plurimath-0.2.9 lib/plurimath/math/function/menclose.rb
plurimath-0.2.8 lib/plurimath/math/function/menclose.rb
plurimath-0.2.7 lib/plurimath/math/function/menclose.rb
plurimath-0.2.6 lib/plurimath/math/function/menclose.rb
plurimath-0.2.5 lib/plurimath/math/function/menclose.rb
plurimath-0.2.4 lib/plurimath/math/function/menclose.rb
plurimath-0.2.3 lib/plurimath/math/function/menclose.rb
plurimath-0.2.2 lib/plurimath/math/function/menclose.rb