diff options
| author | Jun Hiroe <[email protected]> | 2014-04-06 01:41:18 +0900 |
|---|---|---|
| committer | Jun Hiroe <[email protected]> | 2014-04-06 02:45:04 +0900 |
| commit | 1368ae647bc14ad97095c059ce69d8906179440c (patch) | |
| tree | 262cb8e0ba81e2f61eba1fc205c13fa2caa04be5 /mrbgems/mruby-enumerator/mrblib/enumerator.rb | |
| parent | 63dc51c2f90b435361491582aa380bbb5d0476fd (diff) | |
| download | mruby-1368ae647bc14ad97095c059ce69d8906179440c.tar.gz mruby-1368ae647bc14ad97095c059ce69d8906179440c.zip | |
Add args in Enumerator#inspect
Diffstat (limited to 'mrbgems/mruby-enumerator/mrblib/enumerator.rb')
| -rw-r--r-- | mrbgems/mruby-enumerator/mrblib/enumerator.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mrbgems/mruby-enumerator/mrblib/enumerator.rb b/mrbgems/mruby-enumerator/mrblib/enumerator.rb index e1c7d7ef5..7915a8472 100644 --- a/mrbgems/mruby-enumerator/mrblib/enumerator.rb +++ b/mrbgems/mruby-enumerator/mrblib/enumerator.rb @@ -216,7 +216,15 @@ class Enumerator def inspect return "#<#{self.class}: uninitialized>" unless @obj - "#<#{self.class}: #{@obj}:#{@meth}>" + + args = "" + if @args && @args.size > 0 + args = "(" + @args.each {|arg| args << "#{arg}, " } + args = args[0, args.size-2] + args << ")" + end + "#<#{self.class}: #{@obj}:#{@meth}#{args}>" end ## |
