Class: Norman::Adapters::YAML

Inherits:
File show all
Defined in:
lib/norman/adapters/yaml.rb

Overview

An Adapter that uses YAML for its storage.

Instance Attribute Summary

Attributes inherited from File

#file_path, #lock

Attributes inherited from Norman::Adapter

#db, #name

Instance Method Summary collapse

Methods inherited from File

#initialize, #load_database, #save_database

Methods inherited from Norman::Adapter

#db_for, #initialize, #load_database, #save_database

Constructor Details

This class inherits a constructor from Norman::Adapters::File

Instance Method Details

#export_dataObject



12
13
14
# File 'lib/norman/adapters/yaml.rb', line 12

def export_data
  db.to_yaml
end

#import_dataObject



8
9
10
# File 'lib/norman/adapters/yaml.rb', line 8

def import_data
  data = ::YAML.load(::File.read(file_path))
end