Class: Seimi::Equation::Result

Inherits:
Struct
  • Object
show all
Defined in:
lib/seimi/equation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#coefficientsObject

Returns the value of attribute coefficients

Returns:

  • (Object)

    the current value of coefficients



10
11
12
# File 'lib/seimi/equation.rb', line 10

def coefficients
  @coefficients
end

#elementsObject

Returns the value of attribute elements

Returns:

  • (Object)

    the current value of elements



10
11
12
# File 'lib/seimi/equation.rb', line 10

def elements
  @elements
end

#lhs_sizeObject

Returns the value of attribute lhs_size

Returns:

  • (Object)

    the current value of lhs_size



10
11
12
# File 'lib/seimi/equation.rb', line 10

def lhs_size
  @lhs_size
end

#matrixObject

Returns the value of attribute matrix

Returns:

  • (Object)

    the current value of matrix



10
11
12
# File 'lib/seimi/equation.rb', line 10

def matrix
  @matrix
end

#speciesObject

Returns the value of attribute species

Returns:

  • (Object)

    the current value of species



10
11
12
# File 'lib/seimi/equation.rb', line 10

def species
  @species
end

Instance Method Details

#to_kobunObject



15
16
17
18
19
20
21
# File 'lib/seimi/equation.rb', line 15

def to_kobun
  require_relative "kanji"

  left = kobun_terms(0...lhs_size).join(" ")
  right = kobun_terms(lhs_size...species.length).join(" ")
  "#{left} を合せ、#{right} と成り申し候(洋数字にて #{self}) 也"
end

#to_sObject



11
12
13
# File 'lib/seimi/equation.rb', line 11

def to_s
  "#{format_side(0...lhs_size)} -> #{format_side(lhs_size...species.length)}"
end