Class: Klipbook::Sources::KindleDevice::File

Inherits:
Object
  • Object
show all
Defined in:
lib/klipbook/sources/kindle_device/file.rb

Instance Method Summary collapse

Constructor Details

#initialize(infile, max_books, file_parser = FileParser.new) ⇒ File

Returns a new instance of File.



4
5
6
7
8
# File 'lib/klipbook/sources/kindle_device/file.rb', line 4

def initialize(infile, max_books, file_parser=FileParser.new)
  @file_text = infile.read.strip
  @file_parser = file_parser
  @max_books = max_books
end

Instance Method Details

#booksObject

TODO Shift max books here



11
12
13
# File 'lib/klipbook/sources/kindle_device/file.rb', line 11

def books
  @books ||= build_books.take(@max_books)
end