Sha256: a735e9facd8472700838625c0f0d13a01c887a0d9a971df35fc67759462810ab

Contents?: true

Size: 530 Bytes

Versions: 3

Compression:

Stored size: 530 Bytes

Contents

module Daijobu
  module Adapter
    
    def self.get(casket)
      if defined?(MemCache) && casket.is_a?(MemCache)
        Daijobu::Adapter::MemCacheAdapter.new(casket)
      elsif defined?(Rufus::Tokyo::Cabinet) && casket.is_a?(Rufus::Tokyo::Cabinet)
        Daijobu::Adapter::TokyoCabinetAdapter.new(casket)
      elsif defined?(Rufus::Tokyo::Tyrant) && casket.is_a?(Rufus::Tokyo::Tyrant)
        Daijobu::Adapter::TokyoTyrantAdapter.new(casket)
      else
        raise Daijobu::InvalidAdapter
      end
    end
    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sander6-daijobu-0.1.0 lib/daijobu/adapter.rb
sander6-daijobu-0.1.1 lib/daijobu/adapter.rb
sander6-daijobu-0.2.0 lib/daijobu/adapter.rb