Class: Facter::CoreFact

Inherits:
Object
  • Object
show all
Defined in:
lib/facter/framework/core/fact/internal/core_fact.rb

Instance Method Summary collapse

Constructor Details

#initialize(searched_fact) ⇒ CoreFact

Returns a new instance of CoreFact.



5
6
7
# File 'lib/facter/framework/core/fact/internal/core_fact.rb', line 5

def initialize(searched_fact)
  @searched_fact = searched_fact
end

Instance Method Details

#createObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/facter/framework/core/fact/internal/core_fact.rb', line 9

def create
  fact_class = @searched_fact.fact_class

  return unless fact_class

  fact_value = nil
  Facter::Framework::Benchmarking::Timer.measure(@searched_fact.name) do
    fact_value = fact_class.new.call_the_resolver
  end

  fact_value
end