This is one liner.
w+ truncates the file to 0-length and writes as if it were a new file.
options_hash - current value @@options .
To get the full hash, you need getter / accessor. If you included @@options an instance variable instead of a class variable, you could just make attr_accessor :options and then get it with oj.options .
File.open(Dir.pwd + PATH, 'w+') {|f| f.write(options_hash.to_yaml) }
Erik hinton
source share