Class: Copy::Storage::Relational
- Inherits:
-
Object
- Object
- Copy::Storage::Relational
- Defined in:
- lib/copy/storage/relational.rb
Defined Under Namespace
Classes: Document
Instance Method Summary collapse
- #get(name) ⇒ Object
-
#initialize(connection_url) ⇒ Relational
constructor
A new instance of Relational.
- #set(name, content) ⇒ Object
Constructor Details
#initialize(connection_url) ⇒ Relational
Returns a new instance of Relational.
14 15 16 17 18 |
# File 'lib/copy/storage/relational.rb', line 14 def initialize(connection_url) DataMapper.setup(:default, connection_url) DataMapper.finalize DataMapper.auto_upgrade! end |
Instance Method Details
#get(name) ⇒ Object
20 21 22 23 |
# File 'lib/copy/storage/relational.rb', line 20 def get(name) doc = Document.first(:name => name) doc.content unless doc.nil? end |