Re: Reduce three line method to one line
On 22/02/2008, Giant Cranes <ruby-forum@gavinjoyce.com> wrote:
> def get_category_data(category_id)
> rows = []
> FasterCSV.parse(@data) { |row| rows << row if row[0] == category_id }
> rows
> end
FasterCSV.parse(@data).select{|row| row[0] == category_id}
|