Class: Module

Inherits:
Object
  • Object
show all
Defined in:
lib/bandshell/netconfig.rb

Overview

The big idea here is that we have connection methods (layer 2) and addressing methods (layer 3) and by combining that configuration information we end up with a complete network configuration.

Each general layer-2 and layer-3 connection method is represented as a class; adding the specific details creates an instance of the class. The configuration is serialized as the name of the class plus the details needed to reconstruct the instance.

Each instance can contribute lines to /etc/network/interfaces, the Debian standard network configuration file. Each instance also has the opportunity to write out other configuration files such as wpa_supplicant.conf, resolv.conf etc.

Instance Method Summary collapse

Instance Method Details

#basenameObject

Get the name of a class/module and strip off any leading modules. This is useful in determining arguments for Module#const_get.



25
26
27
# File 'lib/bandshell/netconfig.rb', line 25

def basename
  name.gsub(/^.*::/, '')
end