-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Lines 4 to 9 in dec27a8
def my_each | |
for i in 0...size | |
yield(self[i]) | |
end if block_given? | |
to_enum unless block_given? | |
end |
Please add a case for something like this
(1..3).my_each { |i| p i }
If self.is_a?(Range)
you can convert self
to array.
The same for #my_each_with_index
and #my_inject
Metadata
Metadata
Assignees
Labels
No labels