mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Simplified ErrDimensionMismatch class
This commit is contained in:
parent
2f66c443d7
commit
c50d30f659
Notes:
git
2019-11-30 08:01:05 +09:00
1 changed files with 2 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue