Module: UsefulDB

Defined in:
lib/usefuldb.rb,
lib/usefuldb/cli.rb,
lib/usefuldb/version.rb,
lib/usefuldb/settings.rb,
lib/usefuldb/utilities.rb,
lib/usefuldb/exceptions.rb,
lib/usefuldb/json_encoder.rb,
lib/usefuldb/import_export.rb

Defined Under Namespace

Modules: JSONEncoder Classes: CLI, EmptyDB, EntryInDB, EntryNotFound, ImportError, ImportExport, KeyOutOfBounds, Settings, Utils, Version

Class Method Summary collapse

Class Method Details

.add(hash, log) ⇒ Object



14
15
16
# File 'lib/usefuldb.rb', line 14

def add(hash, log)
  UsefulDB::Utils.add(hash, log)
end

.count(log) ⇒ Object



18
19
20
# File 'lib/usefuldb.rb', line 18

def count(log)
  UsefulDB::Utils.count(log)
end

.dbLoad(log, options = {}) ⇒ Object



30
31
32
# File 'lib/usefuldb.rb', line 30

def dbLoad(log, options = {})
  UsefulDB::Utils.dbLoad(log, options)
end

.dbSave(log, options = {}) ⇒ Object



26
27
28
# File 'lib/usefuldb.rb', line 26

def dbSave(log, options = {})
  UsefulDB::Utils.dbSave(log, options)
end

.export(format: :yaml) ⇒ Object



42
43
44
# File 'lib/usefuldb.rb', line 42

def export(format: :yaml)
  UsefulDB::ImportExport.export_content(UsefulDB::Utils.export_data, format: format)
end

.import(data, mode: :merge, log: nil) ⇒ Object



46
47
48
# File 'lib/usefuldb.rb', line 46

def import(data, mode: :merge, log: nil)
  UsefulDB::ImportExport.import!(data, mode: mode, log: log)
end

.remove(key, log) ⇒ Object



22
23
24
# File 'lib/usefuldb.rb', line 22

def remove(key, log)
  UsefulDB::Utils.remove(key, log)
end

.search(args, log) ⇒ Object



34
35
36
# File 'lib/usefuldb.rb', line 34

def search(args, log)
  UsefulDB::Utils.search(args, log)
end

.setup(log) ⇒ Object



38
39
40
# File 'lib/usefuldb.rb', line 38

def setup(log)
  UsefulDB::Utils.setup(log)
end