Module: Memorable::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

#countObject



17
18
19
# File 'lib/podcast_book_club/concerns/memorable.rb', line 17

def count
    self.all.count 
end

#create(attributes) ⇒ Object



21
22
23
24
25
# File 'lib/podcast_book_club/concerns/memorable.rb', line 21

def create(attributes)
    instance = self.new(attributes)
    instance.save
    instance
end

#destroy_allObject



13
14
15
# File 'lib/podcast_book_club/concerns/memorable.rb', line 13

def destroy_all
    self.all.clear
end