module Sorter

Public Instance Methods

sorted_by_ascending_birthdate_and_last_name() click to toggle source
# File lib/cyrus-code-challenge/sorter.rb, line 7
def sorted_by_ascending_birthdate_and_last_name
  Contacts.all.sort_by{|contact| [contact.birth_date, contact.last_name]}
end
sorted_by_ascending_gender_and_last_name() click to toggle source
# File lib/cyrus-code-challenge/sorter.rb, line 3
def sorted_by_ascending_gender_and_last_name
  Contacts.all.sort_by{|contact| [contact.gender, contact.last_name]}
end
sorted_by_last_name_descending() click to toggle source
# File lib/cyrus-code-challenge/sorter.rb, line 11
def sorted_by_last_name_descending
  Contacts.all.sort{|a,b| b.last_name <=> a.last_name}
end