Sha256: cb5f63eadd37d2c8bb08906e1dc0025fec2d861b80af406bfb5ab56748394548
Contents?: true
Size: 496 Bytes
Versions: 10
Compression:
Stored size: 496 Bytes
Contents
module KindleManager class BaseParser attr_accessor :fetched_at def initialize(filepath, options = {}) @filepath = filepath @fetched_at = if File.basename(@filepath) =~ /\A\d{14}/ Time.strptime(File.basename(@filepath)[0..14], KindleManager::FileStore::TIME_FORMAT_FOR_FILENAME) else File.ctime(@filepath) end end def doc @doc ||= Nokogiri::HTML(body) end def body @body ||= File.read(@filepath) end end end
Version data entries
10 entries across 10 versions & 1 rubygems