From 2f66c443d79bb3a2d5518dbe58ca86885bc23d5c Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 29 Nov 2019 17:46:13 +0900 Subject: [PATCH] Support argument for ErrNotRegular --- lib/matrix.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/matrix.rb b/lib/matrix.rb index b4d1be33bb..cf1d532693 100644 --- a/lib/matrix.rb +++ b/lib/matrix.rb @@ -28,8 +28,12 @@ module ExceptionForMatrix # :nodoc: end class ErrNotRegular < StandardError - def initialize - super("Not Regular Matrix") + def initialize(val = nil) + if val + super(val) + else + super("Not Regular Matrix") + end end end