Module: Lib::DHCP::Option::Type::String::ClassMethods

Defined in:
lib/lib/dhcp/options/type/string.rb

Instance Method Summary collapse

Instance Method Details

#unpack(oid, len, payload) ⇒ Object

Raises:

  • (ArgumentError)


40
41
42
43
# File 'lib/lib/dhcp/options/type/string.rb', line 40

def unpack(oid, len, payload)
  raise ArgumentError, "Wrong #{Lib::DHCP::Option::NAME[oid]} Option length - #{len}" unless len > 0
  self.new payload#.unpack('a*').first.to_s
end