Module: Stringex::ActsAsUrl::Adapter

Defined in:
lib/stringex/acts_as_url/adapter.rb,
lib/stringex/acts_as_url/adapter/base.rb,
lib/stringex/acts_as_url/adapter/mongoid.rb,
lib/stringex/acts_as_url/adapter/data_mapper.rb,
lib/stringex/acts_as_url/adapter/active_record.rb

Defined Under Namespace

Classes: ActiveRecord, Base, DataMapper, Mongoid

Class Method Summary collapse

Class Method Details

.add_loaded_adapter(adapter) ⇒ Object



9
10
11
# File 'lib/stringex/acts_as_url/adapter.rb', line 9

def self.add_loaded_adapter(adapter)
  @loaded_adapters << adapter
end

.first_availableObject



21
22
23
# File 'lib/stringex/acts_as_url/adapter.rb', line 21

def self.first_available
  @loaded_adapters[0]
end

.load_availableObject



13
14
15
16
17
18
19
# File 'lib/stringex/acts_as_url/adapter.rb', line 13

def self.load_available
  @loaded_adapters = []
  constants.each do |name|
    adapter = const_get(name)
    adapter.load if adapter.loadable?
  end
end