Class: Iface::CloneFile
- Inherits:
-
ConfigFile
- Object
- ConfigFile
- Iface::CloneFile
- Defined in:
- lib/iface/config_file.rb
Overview
Represents a clone config file (single IP address)
These are files named like “ifcfg-eth0:1”.
Instance Attribute Summary collapse
-
#clone_num ⇒ Object
readonly
Returns the value of attribute clone_num.
-
#ip_address ⇒ Object
readonly
Returns the value of attribute ip_address.
Attributes inherited from ConfigFile
Class Method Summary collapse
Instance Method Summary collapse
- #include?(ip) ⇒ Boolean
-
#initialize(filename, device, _range_num, clone_num, vars) ⇒ CloneFile
constructor
A new instance of CloneFile.
- #static? ⇒ Boolean
Methods inherited from ConfigFile
create, file_type_name, parse_filename
Constructor Details
#initialize(filename, device, _range_num, clone_num, vars) ⇒ CloneFile
Returns a new instance of CloneFile.
103 104 105 106 107 |
# File 'lib/iface/config_file.rb', line 103 def initialize(filename, device, _range_num, clone_num, vars) super @ip_address = vars['ipaddr'] @clone_num = clone_num end |
Instance Attribute Details
#clone_num ⇒ Object (readonly)
Returns the value of attribute clone_num.
97 98 99 |
# File 'lib/iface/config_file.rb', line 97 def clone_num @clone_num end |
#ip_address ⇒ Object (readonly)
Returns the value of attribute ip_address.
97 98 99 |
# File 'lib/iface/config_file.rb', line 97 def ip_address @ip_address end |
Class Method Details
.recognize?(_device, _range_num, clone_num, _vars) ⇒ Boolean
99 100 101 |
# File 'lib/iface/config_file.rb', line 99 def self.recognize?(_device, _range_num, clone_num, _vars) !clone_num.nil? end |
Instance Method Details
#include?(ip) ⇒ Boolean
113 114 115 |
# File 'lib/iface/config_file.rb', line 113 def include?(ip) @ip_address == ip end |
#static? ⇒ Boolean
109 110 111 |
# File 'lib/iface/config_file.rb', line 109 def static? true end |