How can I get a list from a Ruby enumerable?
enumerable, iterator, list, ruby
Solution
`Enumerable#to_a`
Problem
I know of Python's `list` method that can consume all elements from a generator. Is there something like that available in Ruby? I know of : ``` elements = [] enumerable.each {|i| elements << i} ``` I also know of the `inject` alternative. Is there some ready available method?