Class: Loom::Config

Inherits:
Hash
  • Object
show all
Defined in:
lib/loom/config.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.load(path) ⇒ Object

load a new config option



7
8
9
10
# File 'lib/loom/config.rb', line 7

def self.load(path)
	config = Config.new
	config.merge! JSON.parse(File.read(path))
end

Instance Method Details

#save!(path) ⇒ Object



12
13
14
15
16
# File 'lib/loom/config.rb', line 12

def save!(path)
	File.open(path , 'w') do |f| 
     		f.write(JSON.pretty_generate(self)) 
   	end
end