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
5c7aa4f2
Unverified
Commit
5c7aa4f2
authored
May 13, 2021
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify module inclusion for `Array`, `Hash` and `Range`.
parent
2597e519
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
24 deletions
+16
-24
mrblib/array.rb
mrblib/array.rb
+5
-8
mrblib/hash.rb
mrblib/hash.rb
+6
-8
mrblib/range.rb
mrblib/range.rb
+5
-8
No files found.
mrblib/array.rb
View file @
5c7aa4f2
...
...
@@ -4,7 +4,6 @@
#
# ISO 15.2.12
class
Array
##
# Calls the given block for each element of +self+
# and pass the respective element.
...
...
@@ -193,13 +192,6 @@ class Array
return block.call if ret.nil? && block
ret
end
end
##
# Array is enumerable
class Array
# ISO 15.2.12.3
include Enumerable
##
# Sort all elements and replace +self+ with these
...
...
@@ -277,4 +269,9 @@ class Array
self
end
alias entries to_a
##
# Array is enumerable
# ISO 15.2.12.3
include Enumerable
end
mrblib/hash.rb
View file @
5c7aa4f2
...
...
@@ -3,6 +3,12 @@
#
# ISO 15.2.13
class
Hash
##
# Hash is enumerable
#
# ISO 15.2.13.3
include
Enumerable
##
# Equality---Two hashes are equal if they each contain the same number
# of keys and if each key-value pair is equal to (according to
...
...
@@ -297,11 +303,3 @@ class Hash
h
end
end
##
# Hash is enumerable
#
# ISO 15.2.13.3
class
Hash
include
Enumerable
end
mrblib/range.rb
View file @
5c7aa4f2
...
...
@@ -3,6 +3,11 @@
#
# ISO 15.2.14
class
Range
##
# Range is enumerable
#
# ISO 15.2.14.3
include
Enumerable
##
# Calls the given block for each element of +self+
...
...
@@ -80,11 +85,3 @@ class Range
end
alias
entries
to_a
end
##
# Range is enumerable
#
# ISO 15.2.14.3
class
Range
include
Enumerable
end
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