6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/klipbook/sources/kindle_device/entry_parser.rb', line 6
def build_entry(entry_text)
return nil if invalid_entry?(entry_text)
lines = split_text_into_lines(entry_text)
title_line = lines[0].strip
metadata = lines[1].strip
text_lines = lines[3..-1]
type = (metadata)
Klipbook::Sources::KindleDevice::Entry.new do |h|
h.title = (title_line)
h.author = (title_line)
h.location = (metadata)
h.page = (metadata)
h.added_on = (metadata)
h.text = (text_lines)
h.type = (metadata)
end
end
|