Class: Kindle::Exports::Markdown
- Inherits:
-
Object
- Object
- Kindle::Exports::Markdown
- Defined in:
- lib/kindle/exports/markdown.rb
Instance Method Summary collapse
-
#initialize(books) ⇒ Markdown
constructor
A new instance of Markdown.
- #to_s ⇒ Object
Constructor Details
#initialize(books) ⇒ Markdown
Returns a new instance of Markdown.
4 5 6 7 8 9 10 11 12 |
# File 'lib/kindle/exports/markdown.rb', line 4 def initialize(books) @document = "## Kindle Highlights\n\n" books.each do |book| @document << "\n### #{book.title} by #{book.}\n\n" book.highlights.each do |highlight| @document << "> #{highlight.highlight}\n\n" end end end |
Instance Method Details
#to_s ⇒ Object
13 14 15 |
# File 'lib/kindle/exports/markdown.rb', line 13 def to_s @document end |