Class: CanTango::Config::Adapters

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

Instance Attribute Summary

Attributes included from Registry::Base::InstanceMethods

#default, #registered

Instance Method Summary collapse

Methods included from Registry::Base::InstanceMethods

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

Instance Method Details

#adapter(name) ⇒ Object



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

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

#availableObject



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

def available
  [:moneta, :compiler]
end

#use(*names) ⇒ Object



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

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