Class: UsageTracker::Adapter

Inherits:
Object
  • Object
show all
Defined in:
lib/usage_tracker/adapter.rb

Class Method Summary collapse

Class Method Details

.new(settings) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/usage_tracker/adapter.rb', line 6

def self::new(settings)
  klass =
    case settings.adapter
      when 'couchdb'
        Adapters::Couchdb
      when 'redis'
        Adapters::Redis
      when 'mongodb'
        Adapters::Mongodb
    end
  klass::new(settings)
end