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.
23 24 25 |
# File 'lib/phut/virtual_link.rb', line 23 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
20 21 22 |
# File 'lib/phut/virtual_link.rb', line 20 def name @name end |
#port_number=(value) ⇒ Object (writeonly)
Sets the attribute port_number
21 22 23 |
# File 'lib/phut/virtual_link.rb', line 21 def port_number=(value) @port_number = value end |
Instance Method Details
#inspect ⇒ Object
31 32 33 |
# File 'lib/phut/virtual_link.rb', line 31 def inspect to_s end |
#to_s ⇒ Object
27 28 29 |
# File 'lib/phut/virtual_link.rb', line 27 def to_s @name.tr('.', '_') + port_number_string end |