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
- #clear(options = nil) ⇒ Object
- #delete(key, options = nil) ⇒ Object
- #read(key, options = nil) ⇒ Object
- #write(key, attributes, options = nil) ⇒ Object
Instance Method Details
#clear(options = nil) ⇒ Object
22 23 24 25 |
# File 'lib/kood/adapter/user_config.rb', line 22 def clear( = 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, = 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, = 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, = nil) config[key] = attributes config.save end |