class Knowledge::Backupper
Description¶ ↑
Object used to backup configuration variables.
Usage¶ ↑
@example:
backupper = Knowledge::Backupper.new backupper.register(name: :foo, value: 'bar') backupper.register(name: :bar, value: 'baz') backupper.backup!
Attributes¶ ↑
@attr_reader [Hash] configuration @attr_reader [String] path
Attributes
configuration[R]
Configuration
hash
path[R]
Backup file path
Public Class Methods
Public Instance Methods
backup!()
click to toggle source
Backups the configuration.
# File lib/knowledge/backupper.rb, line 57 def backup! f = File.new(path, 'w') f.write(configuration.to_yaml) f.close end