Track filename in book
authorChris Jaekl <cejaekl@yahoo.com>
Thu, 23 Feb 2017 13:09:15 +0000 (22:09 +0900)
committerChris Jaekl <cejaekl@yahoo.com>
Thu, 23 Feb 2017 13:09:15 +0000 (22:09 +0900)
book.rb

diff --git a/book.rb b/book.rb
index 5f14aed14790523eaa012e07857d650bfb43b1e2..814d890a382c9895978746f0df1bcf012216f504 100644 (file)
--- a/book.rb
+++ b/book.rb
@@ -5,6 +5,7 @@ class Book
   def initialize(fileName)
     @author = nil
     @cover = nil
+    @path = fileName
     @series = nil
     @title = nil
     @volume = nil
@@ -28,6 +29,9 @@ class Book
 
   def inspect
     data = []
+    if nil != @author
+      data.push('author="' + @author + '"')
+    end
     if nil != @series
       data.push('series="' + @series + '"')
     end
@@ -37,8 +41,8 @@ class Book
     if nil != @title
       data.push('title="' + @title + '"')
     end
-    if nil != @author
-      data.push('author="' + @author + '"')
+    if nil != @path
+      data.push('path="' + @path + '"')
     end
     return '(Book:' + data.join(',') + ')'
   end