Module: Adapter::UserConfigFile

Defined in:
lib/kood/adapter/user_config.rb

Overview

Simple adapter that uses the user_config gem to persist data into a YAML configuration file.

Instance Method Summary collapse

Instance Method Details

#clear(options = nil) ⇒ Object



22
23
24
25
# File 'lib/kood/adapter/user_config.rb', line 22

def clear(options = nil)
  config.clear
  config.save
end

#delete(key, options = nil) ⇒ Object



17
18
19
20
# File 'lib/kood/adapter/user_config.rb', line 17

def delete(key, options = nil)
  config.delete(key)
  config.save
end

#read(key, options = nil) ⇒ Object



8
9
10
# File 'lib/kood/adapter/user_config.rb', line 8

def read(key, options = nil)
  config[key]
end

#write(key, attributes, options = nil) ⇒ Object



12
13
14
15
# File 'lib/kood/adapter/user_config.rb', line 12

def write(key, attributes, options = nil)
  config[key] = attributes
  config.save
end