Class: DHCP::Opt
- Inherits:
-
Object
- Object
- DHCP::Opt
- Defined in:
- lib/dhcp/options.rb
Overview
Base class from which all DHCP options in a DHCP packet derive:
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#opt ⇒ Object
readonly
Returns the value of attribute opt.
Instance Method Summary collapse
-
#initialize(opt, name, ignore = nil) ⇒ Opt
constructor
A new instance of Opt.
- #opt_header ⇒ Object
- #to_opt ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(opt, name, ignore = nil) ⇒ Opt
Returns a new instance of Opt.
45 46 47 48 |
# File 'lib/dhcp/options.rb', line 45 def initialize(opt, name, ignore=nil) @opt = opt @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
49 50 51 |
# File 'lib/dhcp/options.rb', line 49 def name @name end |
#opt ⇒ Object (readonly)
Returns the value of attribute opt.
49 50 51 |
# File 'lib/dhcp/options.rb', line 49 def opt @opt end |
Instance Method Details
#opt_header ⇒ Object
51 52 53 |
# File 'lib/dhcp/options.rb', line 51 def opt_header "OPTION[#{opt},#{@name}]" end |
#to_opt ⇒ Object
59 60 61 |
# File 'lib/dhcp/options.rb', line 59 def to_opt @opt.chr end |
#to_s ⇒ Object
55 56 57 |
# File 'lib/dhcp/options.rb', line 55 def to_s opt_header end |