class SimpleNoteParser::Base

Attributes

destination[RW]
file[RW]

Public Class Methods

new(file: "./source/notes.json", destination: "./dist") click to toggle source
# File lib/simple_note_parser/base.rb, line 7
def initialize(file: "./source/notes.json", destination: "./dist")
  @file = file
  @destination = destination
end

Public Instance Methods

clean() click to toggle source
# File lib/simple_note_parser/base.rb, line 12
def clean
  FileUtils.rm_rf(destination)
end

Private Instance Methods

create_directory(path) click to toggle source
# File lib/simple_note_parser/base.rb, line 27
def create_directory(path)
  FileUtils.mkdir_p(path) unless Dir.exist?(path)
end
load_json_data(path) click to toggle source
# File lib/simple_note_parser/base.rb, line 18
def load_json_data(path)
  file = File.open path
  JSON.load file
end
parse_json_data(json_data) click to toggle source
# File lib/simple_note_parser/base.rb, line 23
def parse_json_data(json_data)
  json_data["activeNotes"]
end