Sha256: a84f1c3f4edc9a2ac4c5d10ebf7d4d17277ad2fb87e4d25ca4182826a18e0609

Contents?: true

Size: 586 Bytes

Versions: 6

Compression:

Stored size: 586 Bytes

Contents

# frozen_string_literal: true

# This file is part of Alexandria.
#
# See the file README.md for authorship and licensing information.

module Alexandria
  def self.list_books_on_console(_title = true, authors = true)
    collection = Alexandria::LibraryCollection.instance
    collection.reload
    libraries = collection.all_regular_libraries
    output_string = ""
    @books = libraries.flatten
    @books.each do |book|
      book_authors = book.authors.join(" & ") if authors
      output_string += [book.title, book_authors].join(", ") + "\n"
    end
    output_string
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
alexandria-book-collection-manager-0.7.9 lib/alexandria/console.rb
alexandria-book-collection-manager-0.7.8 lib/alexandria/console.rb
alexandria-book-collection-manager-0.7.7 lib/alexandria/console.rb
alexandria-book-collection-manager-0.7.6 lib/alexandria/console.rb
alexandria-book-collection-manager-0.7.5 lib/alexandria/console.rb
alexandria-book-collection-manager-0.7.4 lib/alexandria/console.rb