Sha256: 4caccb7d526adc525d51a9ac6141540242e03c6f8d291468c45f76f6c7c5dbeb
Contents?: true
Size: 1.67 KB
Versions: 3
Compression:
Stored size: 1.67 KB
Contents
# frozen_string_literal: true require_relative "unary_function" module Plurimath module Math module Function class Abs < UnaryFunction attr_accessor :open_paren, :close_paren def to_mathml_without_math_tag symbol = Utility.ox_element("mo") << "|" first_value = mathml_value first_value = first_value&.insert(0, symbol) unless open_paren first_value << symbol unless close_paren Utility.update_nodes(ox_element("mrow"), first_value) end def to_omml_without_math_tag(display_style) Array( md_tag << omml_parameter(parameter_one, display_style, tag_name: "e"), ) end def line_breaking(obj) parameter_one.line_breaking(obj) if obj.value_exist? ceil_object = self.class.new(Utility.filter_values(obj.value)) ceil_object.open_paren = true ceil_object.close_paren = false obj.update(ceil_object) self.close_paren = true self.open_paren = false unless open_paren end end protected def md_tag attribute = { "m:val": "|" } sepchr_attr = { "m:val": "" } mdpr = Utility.pr_element("d", namespace: "m") mdpr << ox_element("begChr", namespace: "m", attributes: attribute) unless open_paren mdpr << ox_element("endChr", namespace: "m", attributes: attribute) unless close_paren mdpr << ox_element("sepChr", namespace: "m", attributes: sepchr_attr) mdpr << ox_element("grow", namespace: "m") ox_element("d", namespace: "m") << mdpr end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
plurimath-0.7.2 | lib/plurimath/math/function/abs.rb |
plurimath-0.7.1 | lib/plurimath/math/function/abs.rb |
plurimath-0.7.0 | lib/plurimath/math/function/abs.rb |