From c49d5c3ea36b85b8628d99c68da464d79556176d Mon Sep 17 00:00:00 2001 From: Chris Jaekl Date: Thu, 23 Feb 2017 22:09:15 +0900 Subject: [PATCH] Track filename in book --- book.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/book.rb b/book.rb index 5f14aed..814d890 100644 --- 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 -- 2.39.2