Class: Ambry::Adapters::YAML

Inherits:
File show all
Defined in:
lib/ambry/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 Ambry::Adapter

#db, #name

Instance Method Summary collapse

Methods inherited from File

#initialize, #load_database, #save_database

Methods inherited from Ambry::Adapter

#db_for, #initialize, #load_database, #save_database

Constructor Details

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

Instance Method Details

#export_dataObject



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

def export_data
  db.to_yaml
end

#import_dataObject



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

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