Class: Phut::VirtualLink::NetworkDeviceName

Inherits:
Object
  • Object
show all
Defined in:
lib/phut/virtual_link.rb

Overview

Creates a valid network device name.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (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

Parameters:

  • value

    the value to set the attribute port_number to.



10
11
12
# File 'lib/phut/virtual_link.rb', line 10

def port_number=(value)
  @port_number = value
end

Instance Method Details

#inspectObject



20
21
22
# File 'lib/phut/virtual_link.rb', line 20

def inspect
  to_s
end

#to_sObject



16
17
18
# File 'lib/phut/virtual_link.rb', line 16

def to_s
  @name.tr('.', '_') + port_number_string
end