Class: YamlDbSynch

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

Class Method Summary collapse

Class Method Details

.db_dump_data_file(ext = "yml", file = "data") ⇒ Object



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

def self.db_dump_data_file (ext = "yml", file = "data")
  "#{dump_dir}/#{file}_db.#{ext}"
end

.dump(file) ⇒ Object



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

def self.dump(file)
  format_class = ENV['class'] || "YamlDb::Helper"
  helper = format_class.constantize
  SerializationHelper::Base.new(helper).dump db_dump_data_file(helper.extension, file)
end

.dump_dirObject



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

def self.dump_dir
  "#{Rails.root}/" + SelfSysteem.test_dir + "/system/support/affirmations"
end

.load(file) ⇒ Object



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

def self.load(file)
  format_class = ENV['class'] || "YamlDb::Helper"
  helper = format_class.constantize
  SerializationHelper::Base.new(helper).load file
end