Class: DHCP::HostNameOption
Overview
This option specifies the name of the client. The name may or may not be qualified with the local domain name (see section 3.17 for the preferred way to retrieve the domain name). See RFC 1035 for character set restrictions.
The code for this option is 12, and its minimum length is 1.
The default value for this option is ‘caprica’
Instance Attribute Summary
Attributes inherited from Option
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ HostNameOption
constructor
A new instance of HostNameOption.
- #to_s ⇒ Object
Methods inherited from Option
Constructor Details
#initialize(params = {}) ⇒ HostNameOption
Returns a new instance of HostNameOption.
146 147 148 149 150 |
# File 'lib/net/dhcp/options.rb', line 146 def initialize(params={}) params[:type] = $DHCP_HOSTNAME params[:payload] = params.fetch(:payload, 'caprica'.unpack('C*')) super(params) end |
Instance Method Details
#to_s ⇒ Object
152 153 154 |
# File 'lib/net/dhcp/options.rb', line 152 def to_s() "Host Name = #{self.payload.pack('C*')}" end |