class DayOne2MD::Converter

Attributes

opts[R]

Public Class Methods

new(opts={}) click to toggle source
# File lib/dayone2md/converter.rb, line 5
def initialize(opts={})
  @opts = opts
end

Public Instance Methods

run() click to toggle source
# File lib/dayone2md/converter.rb, line 9
def run
  DayOneEntry.all(opts[:input]).each do |entry|
    MarkdownEntry.new(
      date:     entry.date,
      title:    entry.title,
      content:  entry.content,
      dir:      opts[:output]
    ).save
  end
end