Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 412aa5f74d
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (21 sloc) 0.426 kb

!SLIDE

Iterators and Enumerable

!SLIDE

Internal Iterators

@@@ Ruby
# The most common internal iterator is #each
# See Enumerable module
[].each { ... }

3.times { ... }

1.upto(10) { ... }

10.downto(1) { ... }

!SLIDE

for

@@@ Ruby
for item in %w( foo bar baz )
  # ... item
end

!SLIDE

Enumerable

@@@ Ruby
%w( foo bar baz ).each { |item| ... }
Jump to Line
Something went wrong with that request. Please try again.