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, io) ⇒ CloneFile
constructor
A new instance of CloneFile.
- #static? ⇒ Boolean
Methods inherited from ConfigFile
create, file_type_name, parse_filename, #to_s, #value_set_class
Constructor Details
#initialize(filename, device, _range_num, clone_num, io) ⇒ CloneFile
Returns a new instance of CloneFile.
150 151 152 153 154 |
# File 'lib/iface/config_file.rb', line 150 def initialize(filename, device, _range_num, clone_num, io) super @ip_address = vars['ipaddr'] @clone_num = clone_num end |
Instance Attribute Details
#clone_num ⇒ Object (readonly)
Returns the value of attribute clone_num.
144 145 146 |
# File 'lib/iface/config_file.rb', line 144 def clone_num @clone_num end |
#ip_address ⇒ Object (readonly)
Returns the value of attribute ip_address.
144 145 146 |
# File 'lib/iface/config_file.rb', line 144 def ip_address @ip_address end |
Class Method Details
.recognize?(_device, _range_num, clone_num) ⇒ Boolean
146 147 148 |
# File 'lib/iface/config_file.rb', line 146 def self.recognize?(_device, _range_num, clone_num) !clone_num.nil? end |
Instance Method Details
#include?(ip) ⇒ Boolean
160 161 162 |
# File 'lib/iface/config_file.rb', line 160 def include?(ip) @ip_address == ip end |
#static? ⇒ Boolean
156 157 158 |
# File 'lib/iface/config_file.rb', line 156 def static? true end |