Skip to content

Commit ce4457c

Browse files
committed
Using generics
1 parent c26f7f9 commit ce4457c

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

sig/matrix.rbs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
type numeric = Integer | Float | Rational | Complex
2-
3-
class Matrix
4-
@rows : Array[Array[numeric]]
5-
attr_reader rows: Array[Array[numeric]]
1+
class Matrix[unchecked out Elem]
2+
@rows : Array[Array[Elem]]
63
end
74

8-
class Vector
9-
@elements : Array[numeric]
10-
attr_reader elements: Array[numeric]
5+
class Vector[unchecked out Elem]
6+
@elements : Array[Elem]
117
end

0 commit comments

Comments
 (0)