Class: Plurimath::Math::Function::Table::Array

Inherits:
Plurimath::Math::Function::Table show all
Defined in:
lib/plurimath/math/function/table/array.rb

Instance Attribute Summary

Attributes inherited from Plurimath::Math::Function::TernaryFunction

#parameter_one, #parameter_three, #parameter_two

Instance Method Summary collapse

Methods inherited from Plurimath::Math::Function::Table

#latex_environment, #to_asciimath, #to_html, #to_mathml_without_math_tag

Methods inherited from Plurimath::Math::Function::TernaryFunction

#==, #class_name, #to_asciimath, #to_html, #to_mathml_without_math_tag

Constructor Details

#initialize(parameter_one = [], parameter_two = "[", parameter_three = "]") ⇒ Array

Returns a new instance of Array.



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

def initialize(parameter_one = [],
               parameter_two = "[",
               parameter_three = "]")
  super
end

Instance Method Details

#to_latexObject



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

def to_latex
  divider     = "{#{parameter_three.map(&:to_latex).join}}"
  first_value = parameter_one&.map(&:to_latex)&.join("\\\\")
  "\\begin{array}#{divider}#{first_value}\\end{array}"
end