Guest User

Untitled

a guest
Apr 26th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. **Agenda Iterators & Blocks**
  2.  
  3. #Bad Git commits & Good Git Commits from Andre
  4.  
  5. #Intro
  6.  
  7. #Recap
  8. - puts and console
  9. - Arrays
  10. - CRUD arrays
  11.  
  12. - Range
  13. - .. ...
  14.  
  15. #Iterators .each
  16. - .each iterate over musicians display "Hello #{musican}"
  17.  
  18. #Iterators .map
  19. - [] -> []
  20. - .upcase musicans, save to new array
  21. 2nd part
  22. - .map to make array with first name of musicians
  23.  
  24. #Iteratorgit .conut
  25. - # [] -> integer
  26. - returns integer of sum of condition == true
  27.  
  28. #Iterator .select & reject
  29. - # [] -> []
  30. - returns new array where condition == true
  31.  
  32. ##!! do not return inside the iterators!!##
  33.  
  34. ## Your job is now to search for new iterators for you excercises
  35. ## Search inside class of arrays in ruby docs
  36. ## Search inside enumerable - any
  37.  
  38.  
  39. #Blocks
  40. - Block is just an argument to a method
  41. - run code for method
  42. - Block returns something
  43.  
  44.  
  45. #Yield
  46. - Yield will run a block of code passed as an argument
  47. - Yield creates an extra "parameter" for a mathod, that will take the block as the argument. for the created parameter.
  48. - Implement bad Timer
  49. - Implement time with yield
  50.  
  51. - Implement yield_greet.rb
  52.  
  53. ##Files:
  54. - Recaps: recap_arrays.rb & recap_range.rb
  55. - .each iterator_each.rb
  56. - .map iterator_map.rb
  57. - .map iterator_first_name_map.rb
  58. - .count iterator_count.rb
  59. - .select iterator_select.rb
  60. - .yield yield_timer.rb &
  61. - .yield yield_greet.rb
Add Comment
Please, Sign In to add comment