0

I am am using DataMapper and Sinatra and I am trying to create a unique set of elements from a DataMapper entity property. I search the database for a collection of entries. These entries all have a "category" property. I would like to find an efficient way to make a new array of all unique category types.

thanks

Jon Rose
  • 1,457
  • 1
  • 15
  • 25
  • and for that you did what? did you try using a ```Set``` – phoet Sep 24 '12 at 08:30
  • yea I am using a set but I was wondering if the only way to do this is to iterate the entire list. Is there a Ruby function for reducing an array based on a filter? – Jon Rose Sep 26 '12 at 18:36

0 Answers0