class Ever2boost::JsonGenerator

Public Class Methods

build(notebook_list) click to toggle source
# File lib/ever2boost/json_generator.rb, line 7
def build(notebook_list)
  {
    folders: notebook_list.map do |list|
      {
        key: list.hash,
        name: list.title,
        color: list.color
      }
    end,
    version: '1.0'
  }.to_json
end
output(notebook_list, output_dir) click to toggle source
# File lib/ever2boost/json_generator.rb, line 20
def output(notebook_list, output_dir)
  Util.make_notes_dir(output_dir)
  File.open("#{output_dir}/boostnote.json", 'w') do |f|
    f.write(build(notebook_list))
  end
end