From: Chris Jaekl Date: Thu, 23 Feb 2017 13:09:15 +0000 (+0900) Subject: Track filename in book X-Git-Url: https://jaekl.net/gitweb/?a=commitdiff_plain;h=c49d5c3ea36b85b8628d99c68da464d79556176d;p=quanlib.git Track filename in book --- 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