Class: MatrixExpansion::Matriz
- Inherits:
-
Object
- Object
- MatrixExpansion::Matriz
- Defined in:
- lib/matrix_expansion/matrix.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#col ⇒ Object
readonly
Returns the value of attribute col.
-
#fil ⇒ Object
readonly
Returns the value of attribute fil.
-
#matrix ⇒ Object
Returns the value of attribute matrix.
Instance Method Summary collapse
-
#initialize(n, m) ⇒ Matriz
constructor
A new instance of Matriz.
Constructor Details
#initialize(n, m) ⇒ Matriz
Returns a new instance of Matriz.
24 25 26 27 28 |
# File 'lib/matrix_expansion/matrix.rb', line 24 def initialize(n, m) raise ArgumentError, 'Valores para filas y columnas incorrectas' unless n.is_a? Fixnum and n > 0 and m.is_a? Fixnum and m > 0 @fil, @col= n, m end |
Instance Attribute Details
#col ⇒ Object (readonly)
Returns the value of attribute col.
21 22 23 |
# File 'lib/matrix_expansion/matrix.rb', line 21 def col @col end |
#fil ⇒ Object (readonly)
Returns the value of attribute fil.
21 22 23 |
# File 'lib/matrix_expansion/matrix.rb', line 21 def fil @fil end |
#matrix ⇒ Object
Returns the value of attribute matrix.
22 23 24 |
# File 'lib/matrix_expansion/matrix.rb', line 22 def matrix @matrix end |