module Analytics::IO # Config operates on .yml configuration file # inside project's root folder. class Config # A path to the .yml configuration file. CONFIG_PATH = "#{PROJ_DIR}/analytics.yml".freeze # Writes to a configuration file. def self.write(data) File.open(CONFIG_PATH, 'w') { |file| YAML.dump(data, file) } end # Reads the configuration file. def self.read YAML.load_file(CONFIG_PATH) end end end