~/talk

Enumerable for Fun & Profit

Talkat RubyConf 2014 · 2014-11-17..11-19· [ruby]
slides:none on file

Shows concretely how hand‑rolled loops, counters and ad hoc arrays get replaced by Enumerable primitives, with tests running green while refactors land. Demonstrates using take and lazy to pull first N items from an infinite range, uses map/collect, select/reject/detect and partition for transformation and filtering, and explains inject for accumulation. Replaces a messy prime‑finder with natural_numbers.select(&:prime?).first(n) and proves the simpler code actually works.

AI-written summary · about

  1. 0:00Introduction to Enumerable
  2. 2:30What Enumerable Provides
  3. 4:14Implementing first_n_elements
  4. 9:09Using take method
  5. 10:15Checking with any?
  6. 14:28Testing with all?
  7. 16:38Verifying with none?
  8. 18:11Mapping elements
  9. 20:30Selecting elements
  10. 23:16Rejecting elements
  11. 25:19Finding first match
  12. 26:44Building with inject
  13. 30:27Filtering emails with grep
  14. 34:30Partitioning elements
  15. 36:29Zipping collections
  16. 37:55Cycling collections
  17. 40:01Generating primes
  18. 44:00Summary & Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.