diff options
author | Hiroshi SHIBATA <[email protected]> | 2019-11-29 17:48:43 +0900 |
---|---|---|
committer | SHIBATA Hiroshi <[email protected]> | 2019-11-30 08:00:40 +0900 |
commit | c50d30f659ff22981444b3e4684fe9e6f2809055 (patch) | |
tree | e0e211333462456373b1be07f69da0ec9db0650a /lib/matrix.rb | |
parent | 2f66c443d79bb3a2d5518dbe58ca86885bc23d5c (diff) |
Simplified ErrDimensionMismatch class
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2699
Diffstat (limited to 'lib/matrix.rb')
-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 |