class DayBooks::Book

Attributes

all_titles[RW]
book_url[RW]
title[RW]

Public Class Methods

all() click to toggle source
# File lib/book.rb, line 13
def self.all
  @@all
end
all_titles() click to toggle source
# File lib/book.rb, line 17
def self.all_titles
  @@all_titles
end
create(title, book_url) click to toggle source
# File lib/book.rb, line 35
def self.create(title, book_url)
  new_book = self.new(title, book_url)
  new_book.save
  new_book
end
downcase_all_titles() click to toggle source
# File lib/book.rb, line 31
def self.downcase_all_titles
  @@all_titles.map {|title| title.downcase}
end
empty_all() click to toggle source
# File lib/book.rb, line 26
def self.empty_all
  @@all.clear
  @@all_titles.clear
end
new(title = nil, book_url = nil) click to toggle source
# File lib/book.rb, line 8
def initialize(title = nil, book_url = nil)
  @title = title
  @book_url = book_url
end

Public Instance Methods

save() click to toggle source
# File lib/book.rb, line 21
def save
  @@all << self
  @@all_titles << @title
end