Method: Origen::SiteConfig::Config#initialize

Defined in:
lib/origen/site_config/config.rb

#initialize(path:, parent:, values: nil) ⇒ Config

Returns a new instance of Config.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/origen/site_config/config.rb', line 11

def initialize(path:, parent:, values: nil)
  @parent = parent
  if path == :runtime
    path = "runtime_#{object_id}"
    @type = :runtime
  elsif path.start_with?('http')
    @path = path
    @type = :centralized
  else
    @path = path
    @type = :local
  end
  @contains_centralized = false
  @loaded = false

  if values
    @values = values
    @loaded = true
  else
    @values = nil
    load
  end
end