Class: RFacter::Config::Settings

Inherits:
Object
  • Object
show all
Defined in:
lib/rfacter/config/settings.rb

Overview

Class for top-level RFacter configuration

Instances of this class hold top-level configuration values and shared service objects such as loggers.

Since:

  • 0.1.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ Settings

Returns a new instance of Settings.

Since:

  • 0.1.0



31
32
33
34
35
36
37
# File 'lib/rfacter/config/settings.rb', line 31

def initialize(**options)
  @logger = RFacter::Util::Logger.new($stderr)
  @logger.level = Logger::WARN

  @profile = false
  @nodes = Hash.new
end

Instance Attribute Details

#loggerLogger (readonly)

Access the logger instance

The object stored here should conform to the interface prresented by the Ruby logger.

Returns:

  • (Logger)

Since:

  • 0.1.0



18
19
20
# File 'lib/rfacter/config/settings.rb', line 18

def logger
  @logger
end

#nodesHash{String => RFacter::Node} (readonly)

A list of nodes to operate on

Returns:

  • (Hash{String => RFacter::Node})

    A list of URIs identifying nodes along with the schemes to use when contacting them.

Since:

  • 0.1.0



24
25
26
# File 'lib/rfacter/config/settings.rb', line 24

def nodes
  @nodes
end

#profileBoolean

A boolean switch for enabling execution profiling

Returns:

  • (Boolean)

    Defaults to false.

Since:

  • 0.1.0



29
30
31
# File 'lib/rfacter/config/settings.rb', line 29

def profile
  @profile
end