Sha256: ae416e2b42a7787a4df9101b17766d84f36f32558dd0d64873e61cf480f5f0d8

Contents?: true

Size: 374 Bytes

Versions: 1

Compression:

Stored size: 374 Bytes

Contents

# frozen_string_literal: true

module Codebreaker
  module Uploader
    PATH_FOLDER = './data_base/'
    PATH_NAME = 'database'
    PATH_FORMAT = '.yaml'
    PATH = PATH_FOLDER + PATH_NAME + PATH_FORMAT

    def load_db
      YAML.load_stream(File.open(PATH))
    end

    def save_to_db(results)
      File.open(PATH, 'a') { |f| f.write results.to_yaml }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
codebreaker_Shkidchenko-0.1.0 lib/app/modules/uploader/uploader.rb