Sha256: 7f027da4de5746f0c1ef32fd7cb1ff470750109b2a7610e15e117c5bec247622

Contents?: true

Size: 512 Bytes

Versions: 11

Compression:

Stored size: 512 Bytes

Contents

# frozen_string_literal: true

module Unitsml
  class Extender
    attr_accessor :symbol

    def initialize(symbol)
      @symbol = symbol
    end

    def ==(object)
      self.class == object.class &&
        symbol == object&.symbol
    end

    def to_mathml
      Utility.ox_element("mo") << "&#x22c5;"
    end

    def to_latex
      "/"
    end

    def to_asciimath
      symbol
    end

    def to_html
      "&#x22c5;"
    end

    def to_unicode
      symbol == "*" ? "ยท" : symbol
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
unitsml-0.8.18 lib/unitsml/extender.rb
unitsml-0.2.9 lib/unitsml/extender.rb
unitsml-0.2.8 lib/unitsml/extender.rb
unitsml-0.2.7 lib/unitsml/extender.rb
unitsml-0.2.6 lib/unitsml/extender.rb
unitsml-0.2.5 lib/unitsml/extender.rb
unitsml-0.2.4 lib/unitsml/extender.rb
unitsml-0.2.3 lib/unitsml/extender.rb
unitsml-0.2.2 lib/unitsml/extender.rb
unitsml-0.2.1 lib/unitsml/extender.rb
unitsml-0.2.0 lib/unitsml/extender.rb