Class: Apical::Adapter

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

Direct Known Subclasses

HttpAdapter, RackAdapter

Class Method Summary collapse

Class Method Details

.[](identifier) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/apical/adapter.rb', line 5

def self.[](identifier)
  @@registry ||= {}
  klass = @@registry[identifier]
  raise "Adapter '#{identifier}' does not exist." unless klass

  klass
end

.identifier(identifier) ⇒ Object



13
14
15
16
# File 'lib/apical/adapter.rb', line 13

def self.identifier(identifier)
  @@registry ||= {}
  @@registry[identifier] = self
end