use is_a? Array for String#% argument check as the original PR did in #2349

This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-06-04 09:08:22 +09:00
parent 9fe8653e86
commit c3ed6e3d25
+3 -3
View File
@@ -1,9 +1,9 @@
class String
def %(args)
if args.is_a? Hash
sprintf(self, args)
else
if args.is_a? Array
sprintf(self, *args)
else
sprintf(self, args)
end
end
end