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, #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, #mathml_nodes, #mini_sized?, #msty_tag_with_attrs, #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



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

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

#cloned_objectsObject



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

def cloned_objects
  self.class.new(text)
end

#to_asciimath(options:) ⇒ Object



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

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

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



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

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



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

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

#to_latex(options:) ⇒ Object



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

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

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



65
66
67
68
69
# File 'lib/plurimath/math/function/unitsml.rb', line 65

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



71
72
73
74
75
# File 'lib/plurimath/math/function/unitsml.rb', line 71

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



41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/plurimath/math/function/unitsml.rb', line 41

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

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



77
78
79
80
81
# File 'lib/plurimath/math/function/unitsml.rb', line 77

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



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

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



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

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

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



83
84
85
86
87
# File 'lib/plurimath/math/function/unitsml.rb', line 83

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