Sha256: 0624cb5a06e4b7d5b4131a9ffd17eebc4354d4dad8e84f1aed18f1622a6c03a6

Contents?: true

Size: 294 Bytes

Versions: 4

Compression:

Stored size: 294 Bytes

Contents

module CodebreakerApi
  PATH = './lib/codebreaker/stats.yml'.freeze

  def stats_base(path = PATH)
    File.exist?(path) && Psych.load(File.read(path))
  end

  def save(data, path = PATH)
    File.open(path, 'w') do |file|
      file.write(Psych.dump(data)) unless data.nil?
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
codebreaker-engine-0.1.2 lib/codebreaker/codebreaker_api.rb
codebreaker-engine-0.1.1 lib/codebreaker/codebreaker_api.rb
codebreaker-engine-0.1.0 lib/codebreaker/codebreaker_api.rb
codebreaker-1.0.0-0.1.0 lib/codebreaker/codebreaker_api.rb