Class: EbooksRenamer::EpubParser
- Inherits:
-
Object
- Object
- EbooksRenamer::EpubParser
- Defined in:
- lib/ebooks_renamer/epub_parser.rb
Class Method Summary collapse
Class Method Details
.parse(filename) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/ebooks_renamer/epub_parser.rb', line 4 def parse(filename) info = EPUBInfo.get(filename) if info.present? title = info.titles.first if info.titles = info.creators.map(&:name).first if info.creators publisher = info.publisher if title.present? OpenStruct.new title: title, author: , publisher: publisher end end end |