class Ez::Settings::Backend::FileSystem
Attributes
file[R]
Public Class Methods
new(file)
click to toggle source
# File lib/ez/settings/backend/file_system.rb, line 11 def initialize(file) @file = file end
Public Instance Methods
read()
click to toggle source
# File lib/ez/settings/backend/file_system.rb, line 15 def read return {} unless File.exist?(file) YAML.load_file(file).deep_symbolize_keys end
write(data)
click to toggle source
# File lib/ez/settings/backend/file_system.rb, line 21 def write(data) File.write(file, read.merge(data).deep_stringify_keys.to_yaml) end