Unlike methods, blocks can access values outside of their bounds. To drive this point home, follow the directions below, declaring empty arrays outside of blocks and pushing values into these arrays from within blocks.
- If you haven't, pull from upstream master.
- Using the data provided in
wine.rb, use.eachto iterate over thewine_cellararray, pushing all Pinot Noirs into a sensibly-named array. - Save and commit your work.
- Now push all wines that with two-word labels into a
long_labeled_winesarray. - Save and commit your work.
- Create two empty arrays,
red_wine_cellarandwhite_wine_cellar, into which you will push the wines into based on their color, i.e. red wines should go into thered_wine_cellarand white wines into thewhite_wine_cellar.