Class: PacketGen::Types::Int8Enum

Inherits:
Enum
  • Object
show all
Defined in:
lib/packetgen/types/enum.rb

Overview

Enumeration on one byte. See Enum.

Author:

  • Sylvain Daubert

Since:

  • 2.1.3

Instance Attribute Summary

Attributes inherited from Enum

#enum

Attributes inherited from Int

#default, #endian, #value, #width

Instance Method Summary collapse

Methods inherited from Enum

#to_human, #value=

Methods inherited from Int

#read, #sz, #to_f, #to_i, #to_s

Constructor Details

#initialize(enum, default = nil) ⇒ Int8Enum

Returns a new instance of Int8Enum.

Parameters:

  • default (Integer) (defaults to: nil)
  • enum (Hash)

Since:

  • 2.1.3



81
82
83
84
# File 'lib/packetgen/types/enum.rb', line 81

def initialize(enum, default=nil)
  super(enum, nil, 1, default)
  @packstr = { nil => 'C' }
end