Class: Plurimath::Math::Function::Unitsml

Inherits:
Core
  • Object
show all
Defined in:
lib/plurimath/math/function/unitsml.rb

Constant Summary

Constants inherited from Core

Core::ALL_PARAMETERS, Core::REPLACABLES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Core

#ascii_fields_to_print, #class_name, #cloned_objects, #common_math_zone_conversion, descendants, #dump_mathml, #dump_nodes, #dump_omml, #dump_ox_nodes, #empty_tag, #extract_class_name_from_text, #extractable?, #filtered_values, #font_style_t_tag, #get, #gsub_spacing, inherited, #insert_t_tag, #invert_unicode_symbols, #is_binary_function?, #is_mrow?, #is_mstyle?, #is_nary_function?, #is_nary_symbol?, #is_ternary_function?, #is_unary?, #latex_fields_to_print, #line_breaking, #linebreak?, #mathml_fields_to_print, #mini_sized?, #nary_attr_value, #nary_intent_name, #omml_fields_to_print, #omml_nodes, #omml_parameter, #omml_tag_name, #ox_element, #paren?, #pretty_print_instance_variables, #prime_unicode?, #r_element, #replacable_values, #result, #separate_table, #set, #symbol?, #tag_name, #to_ms_value, #unicodemath_fields_to_print, #unicodemath_parens, #updated_object_values, #validate_function_formula, #validate_mathml_fields, #variable_value, #variables

Constructor Details

#initialize(text) ⇒ Unitsml

Returns a new instance of Unitsml.



11
12
13
14
# File 'lib/plurimath/math/function/unitsml.rb', line 11

def initialize(text)
  @text = text
  @unitsml = ::Unitsml.parse(text)
end

Instance Attribute Details

#textObject

Returns the value of attribute text.



9
10
11
# File 'lib/plurimath/math/function/unitsml.rb', line 9

def text
  @text
end

Instance Method Details

#==(other) ⇒ Object



16
17
18
19
# File 'lib/plurimath/math/function/unitsml.rb', line 16

def ==(other)
  other.is_a?(Unitsml) &&
    other.text == @text
end

#to_asciimath(options:) ⇒ Object



21
22
23
# File 'lib/plurimath/math/function/unitsml.rb', line 21

def to_asciimath(options:)
  formula(options).to_asciimath(options: options)
end

#to_asciimath_math_zone(spacing = "", last = false, indent = true, options:) ⇒ Object



47
48
49
# File 'lib/plurimath/math/function/unitsml.rb', line 47

def to_asciimath_math_zone(spacing = "", last = false, indent = true, options:)
  formula(options).to_asciimath_math_zone(spacing, last, indent, options: options)
end

#to_html(options:) ⇒ Object



33
34
35
# File 'lib/plurimath/math/function/unitsml.rb', line 33

def to_html(options:)
  formula(options).to_html(options: options)
end

#to_latex(options:) ⇒ Object



25
26
27
# File 'lib/plurimath/math/function/unitsml.rb', line 25

def to_latex(options:)
  formula(options).to_latex(options: options)
end

#to_latex_math_zone(spacing = "", last = false, indent = true, options:) ⇒ Object



51
52
53
# File 'lib/plurimath/math/function/unitsml.rb', line 51

def to_latex_math_zone(spacing = "", last = false, indent = true, options:)
  formula(options).to_latex_math_zone(spacing, last, indent, options: options)
end

#to_mathml_math_zone(spacing = "", last = false, indent = true, options:) ⇒ Object



55
56
57
# File 'lib/plurimath/math/function/unitsml.rb', line 55

def to_mathml_math_zone(spacing = "", last = false, indent = true, options:)
  formula(options).to_mathml_math_zone(spacing, last, indent, options: options)
end

#to_mathml_without_math_tag(intent, options:) ⇒ Object



37
38
39
40
41
# File 'lib/plurimath/math/function/unitsml.rb', line 37

def to_mathml_without_math_tag(intent, options:)
  mathml = formula(options).to_mathml_without_math_tag(intent, options: options)
  mathml["unitsml"] = true
  options&.dig(:unitsml, :xml) ? wrapped_unitsml_xml(mathml, @unitsml, options) : mathml
end

#to_omml_math_zone(spacing = "", last = false, indent = true, options:) ⇒ Object



59
60
61
# File 'lib/plurimath/math/function/unitsml.rb', line 59

def to_omml_math_zone(spacing = "", last = false, indent = true, options:)
  formula(options).to_omml_math_zone(spacing, last, indent, options: options)
end

#to_omml_without_math_tag(display_style, options:) ⇒ Object



43
44
45
# File 'lib/plurimath/math/function/unitsml.rb', line 43

def to_omml_without_math_tag(display_style, options:)
  formula(options).to_omml_without_math_tag(display_style, options: options)
end

#to_unicodemath(options:) ⇒ Object



29
30
31
# File 'lib/plurimath/math/function/unitsml.rb', line 29

def to_unicodemath(options:)
  formula(options).to_unicodemath(options: options)
end

#to_unicodemath_math_zone(spacing = "", last = false, indent = true, options:) ⇒ Object



63
64
65
# File 'lib/plurimath/math/function/unitsml.rb', line 63

def to_unicodemath_math_zone(spacing = "", last = false, indent = true, options:)
  formula(options).to_unicodemath_math_zone(spacing, last, indent, options: options)
end