Class: VimGolf::Config

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

Class Method Summary collapse

Class Method Details

.loadObject



18
19
20
21
22
# File 'lib/vimgolf/config.rb', line 18

def load
  File.open(path + '/config.yaml', 'r') do |f|
    YAML.load(f)
  end
end

.pathObject



4
5
6
# File 'lib/vimgolf/config.rb', line 4

def path
  "#{ENV['HOME']}/.vimgolf"
end

.put_pathObject



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

def put_path
  path + "/put"
end

.save(conf) ⇒ Object



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

def save(conf)
  File.open(path + '/config.yaml', 'w') do |f|
    YAML.dump(conf, f)
  end
end