Sha256: 101f31ce908f21b1699de979f0a505ebd4b12263748fd2066f400e2d9081eecf

Contents?: true

Size: 586 Bytes

Versions: 1

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

1 entries across 1 versions & 1 rubygems

Version Path
alexandria-book-collection-manager-0.7.3 lib/alexandria/console.rb