Class: BookmeterScraper::Scraper::Books

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/bookmeter_scraper/scraper.rb

Instance Method Summary collapse

Constructor Details

#initializeBooks

Returns a new instance of Books.



53
# File 'lib/bookmeter_scraper/scraper.rb', line 53

def initialize; @books = []; end

Instance Method Details

#concat(books) ⇒ Object



55
56
57
58
59
60
# File 'lib/bookmeter_scraper/scraper.rb', line 55

def concat(books)
  books.each do |book|
    next if @books.any? { |b| b.name == book.name && b.author == book.author }
    @books << book
  end
end

#to_aObject



62
# File 'lib/bookmeter_scraper/scraper.rb', line 62

def to_a; @books; end