Method: CMDB::Interface#initialize

Defined in:
lib/cmdb/interface.rb

#initialize(*sources) ⇒ Interface

Create a new instance of the CMDB interface with the specified sources.

Parameters:

  • sources (Array)

    list of String or URI source locations

See Also:



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/cmdb/interface.rb', line 9

def initialize(*sources)
  # ensure no two sources share a prefix
  prefixes = {}
  sources.each do |s|
    next if s.prefix.nil?
    prefixes[s.prefix] ||= []
    prefixes[s.prefix] << s
  end
  check_overlap(prefixes)

  @sources = sources.dup
end