class Bookscan::Books
Public Instance Methods
by_id(book_id,type = nil)
click to toggle source
# File lib/bookscan/book.rb, line 31 def by_id(book_id,type = nil) each do |b| next if type and b.tune_type != type return b if b.book_id == book_id end nil end
has?(book_id)
click to toggle source
# File lib/bookscan/book.rb, line 39 def has?(book_id) each do |b| return true if b.book_id == book_id end false end
ids()
click to toggle source
# File lib/bookscan/book.rb, line 23 def ids a = Array.new each do |b| a << b.book_id end a end
to_s()
click to toggle source
# File lib/bookscan/book.rb, line 11 def to_s table = Mutter::Table.new(:delimiter => '|') do column :style => :green column :width => 100 end each do |b| table << [b.book_id,b.title_short] end table.to_s if length > 0 end