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.
16 17 18 |
# File 'lib/puppet/util/network_device/config.rb', line 16 def devices @devices end |
Class Method Details
.devices ⇒ Object
12 13 14 |
# File 'lib/puppet/util/network_device/config.rb', line 12 def self.devices main.devices || [] end |
.main ⇒ Object
8 9 10 |
# File 'lib/puppet/util/network_device/config.rb', line 8 def self.main @main ||= new end |
Instance Method Details
#exists? ⇒ Boolean
18 19 20 |
# File 'lib/puppet/util/network_device/config.rb', line 18 def exists? Puppet::FileSystem.exist?(@file.to_str) end |
#read(force = false) ⇒ Object
Read the configuration file.
31 32 33 34 35 |
# File 'lib/puppet/util/network_device/config.rb', line 31 def read(force = false) return unless exists? parse if force or @file.changed? end |