# frozen_string_literal: true module Plurimath module Math class Formula attr_accessor :value def initialize(value = []) @value = value.is_a?(Array) ? value : [value] end def ==(object) object.value == value end def to_asciimath value.map(&:to_asciimath).join end def to_mathml <<~MATHML #{mathml_content} MATHML end def to_mathml_without_math_tag "#{mathml_content}" end def mathml_content value.map(&:to_mathml_without_math_tag).join end def to_latex value.map(&:to_latex).join end end end end