module Lib::DHCP::Option::Type::Raw
Public Class Methods
included(base)
click to toggle source
# File lib/lib/dhcp/options/type/raw.rb, line 11 def self.included(base) base.extend ClassMethods end
Public Instance Methods
len()
click to toggle source
# File lib/lib/dhcp/options/type/raw.rb, line 21 def len @len.to_i end
len=(len)
click to toggle source
# File lib/lib/dhcp/options/type/raw.rb, line 17 def len=(len) @len = len.to_i end
pack()
click to toggle source
# File lib/lib/dhcp/options/type/raw.rb, line 25 def pack @payload = '' if @value.nil? [@oid, @len, @payload.to_s].pack("C2a#{@len.to_i}") end
to_s()
click to toggle source
# File lib/lib/dhcp/options/type/raw.rb, line 31 def to_s @payload.unpack('C*').map{|item| item.to_i.to_s(16).rjust(2, '0') }.join(':') end