class DayOne2MD::DayOneEntry
Attributes
entry[R]
Public Class Methods
all(journal_dir)
click to toggle source
# File lib/dayone2md/day_one_entry.rb, line 6 def all(journal_dir) Dir.glob("#{journal_dir}/entries/*.doentry").map { |path| new(path) } end
new(path)
click to toggle source
# File lib/dayone2md/day_one_entry.rb, line 11 def initialize(path) @entry = Plist.parse_xml(path) end
Public Instance Methods
content()
click to toggle source
# File lib/dayone2md/day_one_entry.rb, line 23 def content @content ||= entry.fetch('Entry Text') end
date()
click to toggle source
# File lib/dayone2md/day_one_entry.rb, line 15 def date entry.fetch('Creation Date') end
title()
click to toggle source
# File lib/dayone2md/day_one_entry.rb, line 19 def title content[/\A(.+)\n/,1] end