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)

Returns the value of attribute external_facts.



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

def external_facts
  @external_facts
end

#factsObject (readonly)

Returns the value of attribute facts.



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

def facts
  @facts
end

#internal_factsObject (readonly)

Returns the value of attribute internal_facts.



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
# 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 = []
  load_internal_facts(options)
  load_external_facts(options)

  @facts
end