From d9feed6703e6db86334497e90e9751a974545055 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Tue, 1 Apr 2014 14:31:39 +0900 Subject: move Array#inspect implementation to mrblib/array.rb --- mrblib/array.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'mrblib/array.rb') diff --git a/mrblib/array.rb b/mrblib/array.rb index a7f172879..718553e83 100644 --- a/mrblib/array.rb +++ b/mrblib/array.rb @@ -84,6 +84,17 @@ class Array self end + ## + # Private method for Array creation. + # + # ISO 15.2.12.5.31 (x) + def inspect + return "[]" if self.size == 0 + "["+self.map{|x|x.inspect}.join(", ")+"]" + end + # ISO 15.2.12.5.32 (x) + alias to_s inspect + ## # Delete element with index +key+ def delete(key, &block) -- cgit v1.2.3