Class: Plurimath::Math::Function::Mod
Constant Summary
collapse
- FUNCTION =
{
name: "mod",
first_value: "base",
second_value: "argument",
}
Instance Attribute Summary
#parameter_one, #parameter_two
Instance Method Summary
collapse
#==, #all_values_exist?, #any_value_exist?, #initialize, #to_asciimath_math_zone, #to_latex_math_zone, #to_mathml_math_zone, #to_omml_math_zone
Methods inherited from Core
#ascii_fields_to_print, #class_name, #common_math_zone_conversion, #dump_mathml, #dump_omml, #dump_ox_nodes, #empty_tag, #extract_class_from_text, #extractable?, #filtered_values, #font_style_t_tag, #gsub_spacing, #insert_t_tag, #invert_unicode_symbols, #latex_fields_to_print, #mathml_fields_to_print, #nary_attr_value, #omml_fields_to_print, #omml_nodes, #omml_parameter, #omml_tag_name, #r_element, #tag_name, #validate_function_formula, #validate_mathml_fields
Instance Method Details
#to_asciimath ⇒ Object
15
16
17
18
19
|
# File 'lib/plurimath/math/function/mod.rb', line 15
def to_asciimath
first_value = parameter_one&.to_asciimath
second_value = parameter_two&.to_asciimath
"#{first_value} mod #{second_value}"
end
|
#to_html ⇒ Object
42
43
44
45
46
|
# File 'lib/plurimath/math/function/mod.rb', line 42
def to_html
first_value = "<i>#{parameter_one.to_html}</i>" if parameter_one
second_value = "<i>#{parameter_two.to_html}</i>" if parameter_two
"#{first_value}<i>mod</i>#{second_value}"
end
|
#to_latex ⇒ Object
36
37
38
39
40
|
# File 'lib/plurimath/math/function/mod.rb', line 36
def to_latex
first_value = "{#{parameter_one.to_latex}}" if parameter_one
second_value = "{#{parameter_two.to_latex}}" if parameter_two
"#{first_value} \\mod #{second_value}"
end
|
#to_mathml_without_math_tag ⇒ Object
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/plurimath/math/function/mod.rb', line 21
def to_mathml_without_math_tag
mrow_tag = Utility.ox_element("mrow")
mo_tag = Utility.ox_element("mi") << "mod"
first_value = parameter_one&.to_mathml_without_math_tag if parameter_one
second_value = parameter_two&.to_mathml_without_math_tag if parameter_two
Utility.update_nodes(
mrow_tag,
[
first_value,
mo_tag,
second_value,
],
)
end
|
#to_omml_without_math_tag(display_style) ⇒ Object
48
49
50
51
52
53
54
|
# File 'lib/plurimath/math/function/mod.rb', line 48
def to_omml_without_math_tag(display_style)
values = []
values << parameter_one.insert_t_tag(display_style) if parameter_one
values << r_element("mod")
values << parameter_two.insert_t_tag(display_style) if parameter_two
values
end
|