Class: PacketGen::Types::Int32

Inherits:
Int
  • Object
show all
Defined in:
lib/packetgen/types/int.rb

Overview

4-byte unsigned integer

Author:

  • Sylvain Daubert

Direct Known Subclasses

Int32be, Int32le, SInt32

Instance Attribute Summary

Attributes inherited from Int

#default, #endian, #value, #width

Instance Method Summary collapse

Methods inherited from Int

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

Constructor Details

#initialize(value = nil, endian = :big) ⇒ Int32

Returns a new instance of Int32.

Parameters:

  • value (Integer, nil) (defaults to: nil)
  • endian (:big, :little) (defaults to: :big)


236
237
238
239
# File 'lib/packetgen/types/int.rb', line 236

def initialize(value=nil, endian=:big)
  super(value, endian, 4)
  @packstr = { big: 'N', little: 'V' }
end