diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-11-29 17:48:43 +0900 |
---|---|---|
committer | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2019-11-30 08:00:40 +0900 |
commit | c50d30f659ff22981444b3e4684fe9e6f2809055 (patch) | |
tree | e0e211333462456373b1be07f69da0ec9db0650a /lib | |
parent | 2f66c443d79bb3a2d5518dbe58ca86885bc23d5c (diff) | |
download | ruby-c50d30f659ff22981444b3e4684fe9e6f2809055.tar.gz |
Simplified ErrDimensionMismatch class
Diffstat (limited to 'lib')
-rw-r--r-- | lib/matrix.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/matrix.rb b/lib/matrix.rb index cf1d532693..fc0e8ef2f7 100644 --- a/lib/matrix.rb +++ b/lib/matrix.rb @@ -17,12 +17,10 @@ require_relative "matrix/version" module ExceptionForMatrix # :nodoc: class ErrDimensionMismatch < StandardError def initialize(val = nil) - if val.nil? - super - elsif val.is_a?(String) + if val super(val) else - super("#{val.class.name} dimension mismatch") + super("Dimension mismatch") end end end |