Class: Ettin::Source

Inherits:
Object
  • Object
show all
Defined in:
lib/ettin/source.rb

Overview

Generic interface for data sources containing configuration information.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.for(target) ⇒ Object


7
8
9
10
# File 'lib/ettin/source.rb', line 7

def self.for(target)
  registry.find {|candidate| candidate.handles?(target) }
    .new(target)
end

.register(candidate) ⇒ Object


16
17
18
# File 'lib/ettin/source.rb', line 16

def self.register(candidate)
  registry.unshift(candidate)
end

.register_default(candidate) ⇒ Object


20
21
22
# File 'lib/ettin/source.rb', line 20

def self.register_default(candidate)
  registry << candidate
end

.registryObject


12
13
14
# File 'lib/ettin/source.rb', line 12

def self.registry
  @@registry ||= [] # rubocop:disable Style/ClassVars
end

Instance Method Details

#loadObject

Raises:

  • (NotImplementedError)

24
25
26
# File 'lib/ettin/source.rb', line 24

def load
  raise NotImplementedError
end