Skip to content

Instantly share code, notes, and snippets.

@kblake
Created March 25, 2010 05:27
Show Gist options
  • Save kblake/343220 to your computer and use it in GitHub Desktop.
Save kblake/343220 to your computer and use it in GitHub Desktop.
class Book
include AttributesSort
...
end
def sort_libraries(libraries, key)
libraries.map do |library|
library.attr_sort(:sort_by => key)
end
libraries
end
bobs_books = initialized here...
marys_books = initialized here...
toms_books = initialized here...
sorted_libraries = sort_libraries([bobs_books,marys_books,toms_books],[:author,:date])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment