Class: Facter::FactLoader

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/facter/framework/core/fact_loaders/fact_loader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFactLoader

Returns a new instance of FactLoader.



9
10
11
12
13
14
15
# File 'lib/facter/framework/core/fact_loaders/fact_loader.rb', line 9

def initialize
  @log = Log.new(self)

  @internal_facts = []
  @external_facts = []
  @facts = []
end

Instance Attribute Details

#external_factsObject (readonly)



7
8
9
# File 'lib/facter/framework/core/fact_loaders/fact_loader.rb', line 7

def external_facts
  @external_facts
end

#factsObject (readonly)



7
8
9
# File 'lib/facter/framework/core/fact_loaders/fact_loader.rb', line 7

def facts
  @facts
end

#internal_factsObject (readonly)



7
8
9
# File 'lib/facter/framework/core/fact_loaders/fact_loader.rb', line 7

def internal_facts
  @internal_facts
end

Instance Method Details

#load(options) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/facter/framework/core/fact_loaders/fact_loader.rb', line 17

def load(options)
  @internal_loader ||= InternalFactLoader.new
  @external_fact_loader ||= ExternalFactLoader.new

  @facts = []
  @external_facts = []

  @internal_facts = load_internal_facts(options)
  @external_facts = load_external_facts(options)

  filter_env_facts

  @facts = @internal_facts + @external_facts
end