Class: Plurimath::Math::Function::Mod
Instance Attribute Summary
#parameter_one, #parameter_two
Instance Method Summary
collapse
#==, #initialize
Methods inherited from Core
#class_name, #empty_tag, #insert_t_tag, #nary_attr_value, #omml_parameter, #omml_tag_name, #r_element, #tag_name, #validate_function_formula
Instance Method Details
#to_asciimath ⇒ Object
9
10
11
12
13
|
# File 'lib/plurimath/math/function/mod.rb', line 9
def to_asciimath
first_value = parameter_one&.to_asciimath
second_value = parameter_two&.to_asciimath
"#{first_value} mod #{second_value}"
end
|
#to_html ⇒ Object
36
37
38
39
40
|
# File 'lib/plurimath/math/function/mod.rb', line 36
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
30
31
32
33
34
|
# File 'lib/plurimath/math/function/mod.rb', line 30
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
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/plurimath/math/function/mod.rb', line 15
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 ⇒ Object
42
43
44
45
46
47
48
|
# File 'lib/plurimath/math/function/mod.rb', line 42
def to_omml_without_math_tag
values = []
values << parameter_one.insert_t_tag if parameter_one
values << r_element("mod")
values << parameter_two.insert_t_tag if parameter_two
values
end
|