Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
1368ae64
Commit
1368ae64
authored
Apr 06, 2014
by
Jun Hiroe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add args in Enumerator#inspect
parent
63dc51c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
mrbgems/mruby-enumerator/mrblib/enumerator.rb
mrbgems/mruby-enumerator/mrblib/enumerator.rb
+9
-1
mrbgems/mruby-enumerator/test/enumerator.rb
mrbgems/mruby-enumerator/test/enumerator.rb
+4
-0
No files found.
mrbgems/mruby-enumerator/mrblib/enumerator.rb
View file @
1368ae64
...
...
@@ -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
##
...
...
mrbgems/mruby-enumerator/test/enumerator.rb
View file @
1368ae64
...
...
@@ -90,6 +90,10 @@ end
assert
'Enumerator#inspect'
do
e
=
(
0
..
10
).
each
assert_equal
(
"#<Enumerator: 0..10:each>"
,
e
.
inspect
)
e
=
Enumerator
.
new
(
"FooObject"
,
:foo
,
1
)
assert_equal
(
"#<Enumerator: FooObject:foo(1)>"
,
e
.
inspect
)
e
=
Enumerator
.
new
(
"FooObject"
,
:foo
,
1
,
2
,
3
)
assert_equal
(
"#<Enumerator: FooObject:foo(1, 2, 3)>"
,
e
.
inspect
)
end
assert
'Enumerator#each'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment