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



25
26
27
28
29
30
# File 'lib/rfacter/config/settings.rb', line 25

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

  @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



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

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



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

def nodes
  @nodes
end