summaryrefslogtreecommitdiff
path: root/lib/matrix.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-10-02 16:45:35 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-10-02 16:45:35 +0000
commit29cef5f795043a048a58874d90de0dfe01aa12ea (patch)
tree6ae42a518c1c5705b8f097668d2b83413da0b6ec /lib/matrix.rb
parent8815306dc5aadd777c887bbd8de7057598ad709c (diff)
use Object#class instead of deprecated Object#type.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/matrix.rb')
-rw-r--r--lib/matrix.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/matrix.rb b/lib/matrix.rb
index 8e092b0d0b..706252b091 100644
--- a/lib/matrix.rb
+++ b/lib/matrix.rb
@@ -688,7 +688,7 @@ class Matrix
when Numeric
return Scalar.new(other), self
else
- raise TypeError, "#{type} can't be coerced into #{other.type}"
+ raise TypeError, "#{self.class} can't be coerced into #{other.class}"
end
end
@@ -751,7 +751,7 @@ class Matrix
when Numeric
Scalar.new(@value + other)
when Vector, Matrix
- Scalar.Raise WrongArgType, other.type, "Numeric or Scalar"
+ Scalar.Raise WrongArgType, other.class, "Numeric or Scalar"
when Scalar
Scalar.new(@value + other.value)
else
@@ -765,7 +765,7 @@ class Matrix
when Numeric
Scalar.new(@value - other)
when Vector, Matrix
- Scalar.Raise WrongArgType, other.type, "Numeric or Scalar"
+ Scalar.Raise WrongArgType, other.class, "Numeric or Scalar"
when Scalar
Scalar.new(@value - other.value)
else
@@ -791,7 +791,7 @@ class Matrix
when Numeric
Scalar.new(@value / other)
when Vector
- Scalar.Raise WrongArgType, other.type, "Numeric or Scalar or Matrix"
+ Scalar.Raise WrongArgType, other.class, "Numeric or Scalar or Matrix"
when Matrix
self * _M.inverse
else
@@ -805,7 +805,7 @@ class Matrix
when Numeric
Scalar.new(@value ** other)
when Vector
- Scalar.Raise WrongArgType, other.type, "Numeric or Scalar or Matrix"
+ Scalar.Raise WrongArgType, other.class, "Numeric or Scalar or Matrix"
when Matrix
other.powered_by(self)
else
@@ -1007,7 +1007,7 @@ class Vector
when Numeric
return Scalar.new(other), self
else
- raise TypeError, "#{type} can't be coerced into #{other.type}"
+ raise TypeError, "#{self.class} can't be coerced into #{other.class}"
end
end