Class: CanTango::Configuration::Adapters

Inherits:
Registry::Base show all
Includes:
Singleton
Defined in:
lib/cantango/configuration/adapters.rb

Instance Attribute Summary

Attributes inherited from Registry::Base

#default, #registered

Instance Method Summary collapse

Methods inherited from Registry::Base

#[], #clean!, #default!, #register, #registered?, #types, #types=

Instance Method Details

#adapter(name) ⇒ Object



6
7
8
9
# File 'lib/cantango/configuration/adapters.rb', line 6

def adapter name
  raise "Unknown adapter #{name}" if !available_adapters.include? name.to_sym
  require "cantango/adapter/#{name}"
end

#available_adaptersObject



15
16
17
# File 'lib/cantango/configuration/adapters.rb', line 15

def available_adapters
  [:moneta, :compiler]
end

#use(*names) ⇒ Object



11
12
13
# File 'lib/cantango/configuration/adapters.rb', line 11

def use *names
  names.each {|name| adapter name }
end