Class: BitStruct::HexOctetField

Inherits:
OctetField show all
Defined in:
lib/bit-struct/hex-octet-field.rb

Overview

Class for char fields that can be accessed with values like “xx:xx:xx:xx”, where each xx is up to 2 hex digits representing a single octet. The original string-based accessors are still available with the _chars suffix.

Declared with BitStruct.hex_octets.

Constant Summary collapse

SEPARATOR =
":"
FORMAT =
"%02x"
BASE =
16

Instance Attribute Summary

Attributes inherited from Field

#default, #display_name, #format, #length, #name, #offset, #options

Class Method Summary collapse

Methods inherited from OctetField

#add_accessors_to

Methods inherited from CharField

#add_accessors_to

Methods inherited from Field

#class_name, default, #describe, #initialize, #inspect_in_object, #inspectable?

Constructor Details

This class inherits a constructor from BitStruct::Field

Class Method Details

.class_nameObject

Used in describe.



12
13
14
# File 'lib/bit-struct/hex-octet-field.rb', line 12

def self.class_name
  @class_name ||= "hex_octets"
end