Module: GHTorrent::Persister
- Included in:
- GHTDataRetrieval, GHTLoad, GHTMirrorEvents, GHTMoreCommitsRetriever, GHTRetrieveDependents, GHTRetrieveOne, GHTRetrieveRepo, GHTUpdateRepo, Mirror
- Defined in:
- lib/ghtorrent/persister.rb
Constant Summary collapse
- ADAPTERS =
{ :mongo => GHTorrent::MongoPersister, :noop => GHTorrent::NoopPersister }
Instance Method Summary collapse
-
#connect(adapter, settings) ⇒ Object
Factory method for retrieving persistence connections.
- #disconnect ⇒ Object
Instance Method Details
#connect(adapter, settings) ⇒ Object
Factory method for retrieving persistence connections. The settings argument is a fully parsed YAML document passed on to adapters. The available adapter are ‘mongo’ and ‘noop’
17 18 19 20 |
# File 'lib/ghtorrent/persister.rb', line 17 def connect(adapter, settings) driver = ADAPTERS[adapter.intern] driver.new(settings) end |
#disconnect ⇒ Object
22 23 24 |
# File 'lib/ghtorrent/persister.rb', line 22 def disconnect driver.close end |