3. take & take_while
take(n) gives you the first n elements
take_while { |elem| block } gives you
elements until the block condition is nil or
false
Works on Array and Enumerable
9. drop & drop_while
drop(n) gives you all elements after the first
n elements
drop_while { |elem| block } gives you all
elements starting when the block condition
is nil or false
Works on Array and Enumerable
14. Questions?
Built on an iPad
Photo Credits
http://www.flickr.com/photos/stevewall/802936876/
http://www.flickr.com/photos/z6p6tist6/3967592710/
http://www.flickr.com/photos/whosdadog/3652663745/