Class: Phut::VirtualLink::NetworkDeviceName
- Inherits:
-
Object
- Object
- Phut::VirtualLink::NetworkDeviceName
- Defined in:
- lib/phut/virtual_link.rb
Overview
Creates a valid network device name.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#port_number ⇒ Object
writeonly
Sets the attribute port_number.
Instance Method Summary collapse
-
#initialize(name) ⇒ NetworkDeviceName
constructor
A new instance of NetworkDeviceName.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ NetworkDeviceName
Returns a new instance of NetworkDeviceName.
12 13 14 |
# File 'lib/phut/virtual_link.rb', line 12 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/phut/virtual_link.rb', line 9 def name @name end |
#port_number=(value) ⇒ Object (writeonly)
Sets the attribute port_number
10 11 12 |
# File 'lib/phut/virtual_link.rb', line 10 def port_number=(value) @port_number = value end |
Instance Method Details
#inspect ⇒ Object
20 21 22 |
# File 'lib/phut/virtual_link.rb', line 20 def inspect to_s end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/phut/virtual_link.rb', line 16 def to_s @name.tr('.', '_') + port_number_string end |