Sha256: e6b4b39bc3ebd19fd9ee978af97ed8d7e6d763119cff56845a88e3bf0bae76d8

Contents?: true

Size: 324 Bytes

Versions: 13

Compression:

Stored size: 324 Bytes

Contents

module Codebreaker
  require 'yaml'
  module YamlFile
    def self.load(file_path)
      return unless File.exist?(file_path)

      YAML.safe_load(File.read(file_path), [Symbol], [], true)
    end

    def self.save(file_path, object)
      File.open(file_path, 'w') { |file| file.write(object.to_yaml) }
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
codebreaker-ga-0.2.14 lib/codebreaker/yaml_file.rb
codebreaker-ga-0.2.13 lib/codebreaker/yaml_file.rb
codebreaker-ga-0.2.12 lib/codebreaker/yaml_file.rb
codebreaker-ga-0.2.11 lib/codebreaker/yaml_file.rb
codebreaker-ga-0.2.10 lib/codebreaker/yaml_file.rb
codebreaker-ga-0.2.9 lib/codebreaker/yaml_file.rb
codebreaker-ga-0.2.8 lib/codebreaker/yaml_file.rb
codebreaker-ga-0.2.7 lib/codebreaker/yaml_file.rb
codebreaker-ga-0.2.6 lib/codebreaker/yaml_file.rb
codebreaker-ga-0.2.5 lib/codebreaker/yaml_file.rb
codebreaker-ga-0.2.4 lib/codebreaker/yaml_file.rb
codebreaker-ga-0.2.3 lib/codebreaker/yaml_file.rb
codebreaker-ga-0.2.2 lib/codebreaker/yaml_file.rb