Class: Plurimath::Math::Formula::Mrow
- Inherits:
-
Formula
- Object
- Formula
- Plurimath::Math::Formula::Mrow
- Defined in:
- lib/plurimath/math/formula/mrow.rb
Instance Attribute Summary collapse
-
#is_mrow ⇒ Object
Returns the value of attribute is_mrow.
Instance Method Summary collapse
-
#initialize(value = [], left_right_wrapper = true, display_style: true, input_string: nil) ⇒ Mrow
constructor
A new instance of Mrow.
- #is_mrow? ⇒ Boolean
- #organize_value ⇒ Object
Constructor Details
#initialize(value = [], left_right_wrapper = true, display_style: true, input_string: nil) ⇒ Mrow
Returns a new instance of Mrow.
9 10 11 12 13 14 15 16 17 |
# File 'lib/plurimath/math/formula/mrow.rb', line 9 def initialize( value = [], left_right_wrapper = true, display_style: true, input_string: nil ) super @is_mrow = true end |
Instance Attribute Details
#is_mrow ⇒ Object
Returns the value of attribute is_mrow.
7 8 9 |
# File 'lib/plurimath/math/formula/mrow.rb', line 7 def is_mrow @is_mrow end |
Instance Method Details
#is_mrow? ⇒ Boolean
19 20 21 |
# File 'lib/plurimath/math/formula/mrow.rb', line 19 def is_mrow? @is_mrow end |
#organize_value ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/plurimath/math/formula/mrow.rb', line 23 def organize_value return if value.any?(String) return unless is_mrow value.each_with_index do |element, index| update_current_element(element, value, index) if value[index + 1].is_a?(Math::Function::Mod) update_mod_function(value, index) elsif unary_function_updatable?(value, element, index) unary_function_update(value, index) elsif value.first.paren? && value.last.paren? organize_fencing(value) elsif valid_underset_function?(element) value[index] = new_nary_element(element, value) elsif valid_underover_function?(element) replace_with_nary_function(element, value, index) elsif ternary_function_third_value_present?(element) element.parameter_three = value.delete_at(index + 1) end end end |