class Moodwall::ConfigFile
Constants
- DIRECTORY
- FILE
Attributes
data[R]
path[R]
Public Class Methods
new()
click to toggle source
# File lib/moodwall/config_file.rb, line 11 def initialize @path = File.join(DIRECTORY, FILE) create_directory && prepare_file @data = YAML.safe_load(File.read(path)) || {} end
Private Instance Methods
create_directory()
click to toggle source
# File lib/moodwall/config_file.rb, line 19 def create_directory FileUtils.mkdir_p(DIRECTORY) end
prepare_file()
click to toggle source
# File lib/moodwall/config_file.rb, line 23 def prepare_file FileUtils.touch(path) end