Start support for reading data back from the database.
[quanlib.git] / book.rb
diff --git a/book.rb b/book.rb
index d7a2a26e24d27d6d99cc3df50acb1d75818b6397..03a5f259beb0005d4250bd7988edab21729ba41d 100644 (file)
--- a/book.rb
+++ b/book.rb
@@ -8,16 +8,18 @@ require 'cover'
 class Book
   @@DC_NS_URL = 'http://purl.org/dc/elements/1.1/'
 
-  def initialize(fileName)
-    #puts 'InitBook(' + fileName + ')'
+  def initialize
     @author = nil
     @cover = nil
     @description = nil
-    @path = fileName
+    @path = nil
     @series = nil
     @title = nil
     @volume = nil
+  end
 
+  def loadFromFile(fileName)
+    @path = fileName
     parseFileName!(fileName)
   end
 
@@ -57,7 +59,7 @@ class Book
       result.push('<i>(Unknown title)</i>')
     end
     if nil != @author
-      result.push('<i>by ' + @author.to_s() + '</i>')
+      result.push('<i>by ' + @author.reading_order + '</i>')
     end
     
     seriesInfo = []