Class: Puppet::Util::NetworkDevice::Config
- Defined in:
- lib/puppet/util/network_device/config.rb
Instance Attribute Summary collapse
-
#devices ⇒ Object
readonly
Returns the value of attribute devices.
Class Method Summary collapse
Instance Method Summary collapse
- #exists? ⇒ Boolean
-
#initialize ⇒ Config
constructor
A new instance of Config.
-
#read(force = false) ⇒ Object
Read the configuration file.
Constructor Details
Instance Attribute Details
#devices ⇒ Object (readonly)
Returns the value of attribute devices.
15 16 17 |
# File 'lib/puppet/util/network_device/config.rb', line 15 def devices @devices end |
Class Method Details
.devices ⇒ Object
11 12 13 |
# File 'lib/puppet/util/network_device/config.rb', line 11 def self.devices main.devices || [] end |
.main ⇒ Object
7 8 9 |
# File 'lib/puppet/util/network_device/config.rb', line 7 def self.main @main ||= self.new end |
Instance Method Details
#exists? ⇒ Boolean
17 18 19 |
# File 'lib/puppet/util/network_device/config.rb', line 17 def exists? Puppet::FileSystem.exist?(@file.to_str) end |
#read(force = false) ⇒ Object
Read the configuration file.
30 31 32 33 34 |
# File 'lib/puppet/util/network_device/config.rb', line 30 def read(force = false) return unless exists? parse if force or @file.changed? end |