A cool thing in ruby --- you can tell movies what attribute you want it to collect. (collect is an alias for map, so I'm going to use map below)

```
data = movies.map(&:attribute)
data.inject(0.0) { |sum, rating| sum + rating } / data.size
```