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.



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

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

Instance Method Details

#booksObject

TODO Shift max books here



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

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