Class: YamlDb::Load

Inherits:
SerializationHelper::Load
  • Object
show all
Defined in:
lib/yaml_db.rb

Class Method Summary collapse

Class Method Details

.load_documents(io, truncate = true) ⇒ Object


61
62
63
64
65
66
67
68
# File 'lib/yaml_db.rb', line 61

def self.load_documents(io, truncate = true)
    YAML.load_documents(io) do |ydoc|
      ydoc.keys.each do |table_name|
        next if ydoc[table_name].nil?
        load_table(table_name, ydoc[table_name], truncate)
      end
    end
end