Class: PacketGen::Types::Int16

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

Overview

2-byte integer

Author:

  • Sylvain Daubert

Direct Known Subclasses

Int16be, Int16le

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) ⇒ Int16



97
98
99
100
# File 'lib/packetgen/types/int.rb', line 97

def initialize(value=nil, endian=:big)
  super(value, endian, 2)
  @packstr = { big: 'n', little: 'v' }
end