Class: PuppetX::Relay::Util::FileSettings

Inherits:
OverlaySettings show all
Defined in:
lib/puppet_x/relay/util/settings.rb

Defined Under Namespace

Classes: HieraConfigurationError

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OverlaySettings

#[], #each

Methods inherited from Settings

#[], #each

Constructor Details

#initialize(parent, file: nil) ⇒ FileSettings

Returns a new instance of FileSettings.

Parameters:

  • file (String) (defaults to: nil)


77
78
79
80
81
82
# File 'lib/puppet_x/relay/util/settings.rb', line 77

def initialize(parent, file: nil)
  file ||= File.join(Puppet[:confdir], 'relay.yaml')
  super(parent, maybe_from_eyaml(YAML.load_file(file)).transform_keys(&:to_sym))
rescue Errno::ENOENT
  super(parent, {})
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



74
75
76
# File 'lib/puppet_x/relay/util/settings.rb', line 74

def file
  @file
end