Module: Sortable::ClassMethods

Included in:
Author, Book, Episode, Genre
Defined in:
lib/podcast_book_club/concerns/sortable.rb

Instance Method Summary collapse

Instance Method Details

#sort_by_nameObject



8
9
10
# File 'lib/podcast_book_club/concerns/sortable.rb', line 8

def sort_by_name
    self.all.sort {|left, right| left.name <=> right.name}
end

#sort_by_titleObject



4
5
6
# File 'lib/podcast_book_club/concerns/sortable.rb', line 4

def sort_by_title
    self.all.sort {|left, right| left.title <=> right.title}
end